in clock-bound-d/src/response.rs [548:571]
fn test_build_response_header_error_successful() {
// Any request other than 1, 2 or 3 should reply with an Error (0) response
let request_type: u8 = 0;
let header = build_response_header(request_type, 0);
let mut rdr = Cursor::new(header);
assert_eq!(RESPONSE_VERSION, rdr.read_u8().unwrap());
assert_eq!(request_type, rdr.read_u8().unwrap());
//sync flag
assert_eq!(0, rdr.read_u8().unwrap());
//reserved
assert_eq!(0, rdr.read_u8().unwrap());
// Test a non 0 value as well.
let request_type: u8 = 8;
let header = build_response_header(request_type, 0);
let mut rdr = Cursor::new(header);
assert_eq!(RESPONSE_VERSION, rdr.read_u8().unwrap());
// Should respond with an Error (0) response
assert_eq!(0, rdr.read_u8().unwrap());
//sync flag
assert_eq!(0, rdr.read_u8().unwrap());
//reserved
assert_eq!(0, rdr.read_u8().unwrap());
}