diff --git a/formats/valid_fail_expr.ksy b/formats/valid_fail_expr.ksy index 444eb0795..c6aae1286 100644 --- a/formats/valid_fail_expr.ksy +++ b/formats/valid_fail_expr.ksy @@ -7,5 +7,5 @@ seq: expr: _ == 1 - id: bar type: s2le - valid: # there's actually -190 in the file + valid: # there is actually -190 in the file expr: _ < -190 or _ > -190 diff --git a/formats/valid_fail_repeat_anyof_int.ksy b/formats/valid_fail_repeat_anyof_int.ksy new file mode 100644 index 000000000..57762a4d6 --- /dev/null +++ b/formats/valid_fail_repeat_anyof_int.ksy @@ -0,0 +1,11 @@ +meta: + id: valid_fail_repeat_anyof_int +seq: + - id: foo + type: u1 + valid: # there is actually 0xe8 in the file + any-of: + - 0 + - 1 + - 0x41 + repeat: eos diff --git a/formats/valid_fail_repeat_contents.ksy b/formats/valid_fail_repeat_contents.ksy new file mode 100644 index 000000000..7ee2aafea --- /dev/null +++ b/formats/valid_fail_repeat_contents.ksy @@ -0,0 +1,6 @@ +meta: + id: valid_fail_repeat_contents +seq: + - id: foo + contents: [0x12, 0x34, 0x56, 0x78] # there is actually [0x00, 0x12, 0x34, 0x56] in the file + repeat: eos diff --git a/formats/valid_fail_repeat_eq_int.ksy b/formats/valid_fail_repeat_eq_int.ksy new file mode 100644 index 000000000..56886b16c --- /dev/null +++ b/formats/valid_fail_repeat_eq_int.ksy @@ -0,0 +1,8 @@ +meta: + id: valid_fail_repeat_eq_int + endian: be +seq: + - id: foo + type: u4 + valid: 0x12_34_56_78 # there is actually 0x00_12_34_56 in the file + repeat: eos diff --git a/formats/valid_fail_repeat_expr.ksy b/formats/valid_fail_repeat_expr.ksy new file mode 100644 index 000000000..a61a4fddd --- /dev/null +++ b/formats/valid_fail_repeat_expr.ksy @@ -0,0 +1,10 @@ +meta: + id: valid_fail_repeat_expr +seq: + - id: foo + size: 4 + valid: + # there is actually [0x00, 0x12, 0x34, 0x56] in the file + # (this `valid/expr` asserts that this particular value does not occur) + expr: _ != [0x00, 0x12, 0x34, 0x56] + repeat: eos diff --git a/formats/valid_fail_repeat_inst.ksy b/formats/valid_fail_repeat_inst.ksy new file mode 100644 index 000000000..87642c1d2 --- /dev/null +++ b/formats/valid_fail_repeat_inst.ksy @@ -0,0 +1,13 @@ +meta: + id: valid_fail_repeat_inst + endian: be +seq: + - id: a + size: 0 + if: inst.size == 0 # invoke instance +instances: + inst: + pos: 0 + type: u4 + valid: 0x12_34_56_78 # there is actually 0x00_12_34_56 in the file + repeat: eos diff --git a/formats/valid_fail_repeat_max_int.ksy b/formats/valid_fail_repeat_max_int.ksy new file mode 100644 index 000000000..444fc6f05 --- /dev/null +++ b/formats/valid_fail_repeat_max_int.ksy @@ -0,0 +1,8 @@ +meta: + id: valid_fail_repeat_max_int +seq: + - id: foo + type: u1 + valid: + max: 0xfe # there is actually 0xff in the file + repeat: eos diff --git a/formats/valid_fail_repeat_min_int.ksy b/formats/valid_fail_repeat_min_int.ksy new file mode 100644 index 000000000..38238e886 --- /dev/null +++ b/formats/valid_fail_repeat_min_int.ksy @@ -0,0 +1,8 @@ +meta: + id: valid_fail_repeat_min_int +seq: + - id: foo + type: s1 + valid: + min: 0 # there is actually -24 (0xe8) in the file + repeat: eos diff --git a/spec/ks/valid_fail_repeat_anyof_int.kst b/spec/ks/valid_fail_repeat_anyof_int.kst new file mode 100644 index 000000000..c358f3317 --- /dev/null +++ b/spec/ks/valid_fail_repeat_anyof_int.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_anyof_int +data: process_coerce_bytes.bin +exception: ValidationNotAnyOfError diff --git a/spec/ks/valid_fail_repeat_contents.kst b/spec/ks/valid_fail_repeat_contents.kst new file mode 100644 index 000000000..38052f90a --- /dev/null +++ b/spec/ks/valid_fail_repeat_contents.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_contents +data: bcd_user_type_be.bin +exception: ValidationNotEqualError diff --git a/spec/ks/valid_fail_repeat_eq_int.kst b/spec/ks/valid_fail_repeat_eq_int.kst new file mode 100644 index 000000000..f0141e49d --- /dev/null +++ b/spec/ks/valid_fail_repeat_eq_int.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_eq_int +data: bcd_user_type_be.bin +exception: ValidationNotEqualError diff --git a/spec/ks/valid_fail_repeat_expr.kst b/spec/ks/valid_fail_repeat_expr.kst new file mode 100644 index 000000000..10881b0f2 --- /dev/null +++ b/spec/ks/valid_fail_repeat_expr.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_expr +data: bcd_user_type_be.bin +exception: ValidationExprError diff --git a/spec/ks/valid_fail_repeat_inst.kst b/spec/ks/valid_fail_repeat_inst.kst new file mode 100644 index 000000000..3905d2c5f --- /dev/null +++ b/spec/ks/valid_fail_repeat_inst.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_inst +data: bcd_user_type_be.bin +exception: ValidationNotEqualError diff --git a/spec/ks/valid_fail_repeat_max_int.kst b/spec/ks/valid_fail_repeat_max_int.kst new file mode 100644 index 000000000..1a9f5d5f7 --- /dev/null +++ b/spec/ks/valid_fail_repeat_max_int.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_max_int +data: nav_parent_switch.bin +exception: ValidationGreaterThanError diff --git a/spec/ks/valid_fail_repeat_min_int.kst b/spec/ks/valid_fail_repeat_min_int.kst new file mode 100644 index 000000000..6bf56a824 --- /dev/null +++ b/spec/ks/valid_fail_repeat_min_int.kst @@ -0,0 +1,3 @@ +id: valid_fail_repeat_min_int +data: process_coerce_bytes.bin +exception: ValidationLessThanError