fix some of the failing tests
diff --git a/test/qcbor_decode_tests.c b/test/qcbor_decode_tests.c
index f748104..f07a185 100644
--- a/test/qcbor_decode_tests.c
+++ b/test/qcbor_decode_tests.c
@@ -4640,8 +4640,13 @@
{ {(uint8_t[]){0xC4, 0x82, 0x1f, 0x01}, 4}, QCBOR_ERR_BAD_INT},
// 3 items in array
{ {(uint8_t[]){0xC4, 0x83, 0x03, 0x01, 02}, 5}, QCBOR_ERR_BAD_EXP_AND_MANTISSA},
+#ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS
// unterminated indefinite length array
{ {(uint8_t[]){0xC4, 0x9f, 0x03, 0x01, 0x02}, 5}, QCBOR_ERR_BAD_EXP_AND_MANTISSA},
+#else /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
+ // unterminated indefinite length array
+ { {(uint8_t[]){0xC4, 0x9f, 0x03, 0x01, 0x02}, 5}, QCBOR_ERR_INDEF_LEN_ARRAYS_DISABLED},
+#endif /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
// Empty array
{ {(uint8_t[]){0xC4, 0x80}, 2}, QCBOR_ERR_NO_MORE_ITEMS},
// Second is not an integer
@@ -6013,6 +6018,7 @@
// Get a second item
uCBORError = QCBORDecode_GetNext(&DCtx, &Item);
+#ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS
if(uCBORError != QCBOR_SUCCESS) {
return 9;
}
@@ -6026,6 +6032,11 @@
if(uCBORError != QCBOR_ERR_ARRAY_OR_MAP_UNCONSUMED) {
return 11;
}
+#else /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
+ if(uCBORError != QCBOR_ERR_INDEF_LEN_ARRAYS_DISABLED) {
+ return 20;
+ }
+#endif /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
// --- Sequence with a closed indefinite length array ---
@@ -6046,6 +6057,8 @@
// Get a second item
uCBORError = QCBORDecode_GetNext(&DCtx, &Item);
+#ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS
+
if(uCBORError != QCBOR_SUCCESS) {
return 14;
}
@@ -6059,6 +6072,11 @@
if(uCBORError != QCBOR_SUCCESS) {
return 16;
}
+#else /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
+ if(uCBORError != QCBOR_ERR_INDEF_LEN_ARRAYS_DISABLED) {
+ return 20;
+ }
+#endif /* QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
return 0;
diff --git a/test/run_tests.c b/test/run_tests.c
index b2dc46c..2936577 100644
--- a/test/run_tests.c
+++ b/test/run_tests.c
@@ -63,8 +63,11 @@
TEST_ENTRY(EmptyMapsAndArraysTest),
TEST_ENTRY(NotWellFormedTests),
TEST_ENTRY(ParseMapAsArrayTest),
+#ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS
TEST_ENTRY(IndefiniteLengthNestTest),
+ TEST_ENTRY(IndefiniteLengthArrayMapTest),
TEST_ENTRY(NestedMapTestIndefLen),
+#endif
TEST_ENTRY(ParseSimpleTest),
TEST_ENTRY(DecodeFailureTests),
TEST_ENTRY(EncodeRawTest),
@@ -82,7 +85,6 @@
TEST_ENTRY(ParseTooDeepArrayTest),
TEST_ENTRY(ComprehensiveInputTest),
TEST_ENTRY(ParseMapTest),
- TEST_ENTRY(IndefiniteLengthArrayMapTest),
TEST_ENTRY(BasicEncodeTest),
TEST_ENTRY(NestedMapTest),
TEST_ENTRY(BignumParseTest),