Option to disable indefinite length string decoding (#61)
No semantic or interface changes.
Allows #define of QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS to disable handling of indefinite length strings and the memory pool saving 400 bytes of object code.
Also some minor code improvements and lots of improvements to comments on code that handles indefinite length strings.
Co-authored-by: Laurence Lundblade <lgl@securitytheory.com>
diff --git a/test/run_tests.c b/test/run_tests.c
index aa42013..b2dc46c 100644
--- a/test/run_tests.c
+++ b/test/run_tests.c
@@ -63,7 +63,6 @@
TEST_ENTRY(EmptyMapsAndArraysTest),
TEST_ENTRY(NotWellFormedTests),
TEST_ENTRY(ParseMapAsArrayTest),
- TEST_ENTRY(AllocAllStringsTest),
TEST_ENTRY(IndefiniteLengthNestTest),
TEST_ENTRY(NestedMapTestIndefLen),
TEST_ENTRY(ParseSimpleTest),
@@ -95,8 +94,13 @@
TEST_ENTRY(ParseDeepArrayTest),
TEST_ENTRY(SimpleArrayTest),
TEST_ENTRY(IntegerValuesParseTest),
+#ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS
+ TEST_ENTRY(AllocAllStringsTest),
TEST_ENTRY(MemPoolTest),
TEST_ENTRY(IndefiniteLengthStringTest),
+ TEST_ENTRY(SpiffyIndefiniteLengthStringsTests),
+ TEST_ENTRY(SetUpAllocatorTest),
+#endif /* #ifndef QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS */
#ifndef QCBOR_DISABLE_PREFERRED_FLOAT
TEST_ENTRY(HalfPrecisionDecodeBasicTests),
TEST_ENTRY(DoubleAsSmallestTest),
@@ -112,7 +116,6 @@
TEST_ENTRY_DISABLED(BigComprehensiveInputTest),
TEST_ENTRY_DISABLED(TooLargeInputTest),
TEST_ENTRY(EncodeErrorTests),
- TEST_ENTRY(SetUpAllocatorTest),
TEST_ENTRY(SimpleValuesIndefiniteLengthTest1),
TEST_ENTRY(EncodeLengthThirtyoneTest),
TEST_ENTRY(CBORSequenceDecodeTests),
@@ -124,7 +127,6 @@
TEST_ENTRY(ExponentAndMantissaDecodeTests),
TEST_ENTRY(ExponentAndMantissaDecodeFailTests),
TEST_ENTRY(ExponentAndMantissaEncodeTests),
- TEST_ENTRY(SpiffyIndefiniteLengthStringsTests),
#endif /* QCBOR_CONFIG_DISABLE_EXP_AND_MANTISSA */
};