Add another test for indef length arrays
diff --git a/README.md b/README.md
index 2f30108..9937e6c 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,9 @@
 
 **Small simple memory model** – Malloc is not used. The encode context is 128 bytes, decode context is 168 bytes and the description of decoded data item is 56 bytes. Stack use is very light and there is no recursion. The caller supplies the memory to hold the encoded CBOR and encode/decode contexts so caller has full control of memory usage and it is good for embedded implementations that have to run in small fixed memory. 
 
-**Supports nearly all of RFC 7049** – Only minor, corner-case parts of RFC 7049 are not directly supported (canonicalization, decimal fractions, big floats) (indefinite length support is planned, but not ready yet).
+**Supports nearly all of RFC 7049** – Only minor, corner-case parts of RFC 7049 are not directly supported (canonicalization, decimal fractions, big floats). Decoding
+indefinite length strings but requires a string allocator (see documentation). Encoding indefinite length strings is not supported, but
+is also not necessary or preferred.
 
 **Extensible and General** – Provides a way to handle data types that are not directly supported.
 
@@ -26,7 +28,6 @@
 This code in Laurence's GitHub has diverged some from the CAF source with some small simplifications and tidying up.  The full test suite is not up and running and available in GitHub yet, so some caution is advised. This should be remedies soon.
 
 The following modifications are planned:
-* Indefinite length support
 * Improve design for handling multiple tags
 
 These changes may result in some interface changes. 
@@ -56,16 +57,16 @@
 
 
 ## Changes from CAF Version
-* QCBOREncode_Init takes a UsefulBuf instead of a pointer and size
-* QCBOREncode_Finish takes a UsefulBufC and EncodedCBOR is remove
-* bstr wrapping of arrays/maps is replaced with OpenBstrwrap
-* AddRaw can now only add whole arrays or maps, not partial maps and arrays (simplification; was a dangerous feature)
-* Finish cannot be called repeatedly on a partial decode (some tests used this, but it is not really a good thing to rely on)
 * Float support is restored
-* Minimal length float is restored
+* Minimal length float encoding is added
 * indefinite length arrays/maps are supported
 * indefinite length strings are supported
 * Addition functions in UsefulBuf
+* QCBOREncode_Init takes a UsefulBuf instead of a pointer and size
+* QCBOREncode_Finish takes a UsefulBufC and EncodedCBOR is remove
+* bstr wrapping of arrays/maps is replaced with OpenBstrwrap
+* AddRaw renamed to AddEncoded and can now only add whole arrays or maps, not partial maps and arrays (simplification; was a dangerous feature)
+* Finish cannot be called repeatedly on a partial decode (some tests used this, but it is not really a good thing to use in the first place)
 * UsefulOutBuf_OutUBuf changed to work differently 
 * UsefulOutBuf_Init works differently
 
diff --git a/test/qcbor_decode_tests.c b/test/qcbor_decode_tests.c
index e8eca35..e534460 100644
--- a/test/qcbor_decode_tests.c
+++ b/test/qcbor_decode_tests.c
@@ -1579,31 +1579,79 @@
 }
 
 
+static UsefulBufC make_nested_indefinite_arrays(int n, UsefulBuf Storage)
+{
+   UsefulOutBuf UOB;
+   UsefulOutBuf_Init(&UOB, Storage);
+   
+   int i;
+   for(i = 0; i < n; i++) {
+      UsefulOutBuf_AppendByte(&UOB, 0x9f);
+   }
+
+   for(i = 0; i < n; i++) {
+      UsefulOutBuf_AppendByte(&UOB, 0xff);
+   }
+   return UsefulOutBuf_OutUBuf(&UOB);
+}
 
 
+static int parse_indeflen_nested(UsefulBufC Nested, int nNestLevel)
+{
+   QCBORDecodeContext DC;
+   QCBORDecode_Init(&DC, Nested, 0);
+   
+   int j;
+   for(j = 0; j < nNestLevel; j++) {
+      QCBORItem Item;
+      int nReturn = QCBORDecode_GetNext(&DC, &Item);
+      if(j >= QCBOR_MAX_ARRAY_NESTING) {
+         // Should be in error
+         if(nReturn != QCBOR_ERR_ARRAY_NESTING_TOO_DEEP) {
+            return -4;
+         } else {
+            return 0; // Decoding doesn't recover after an error
+         }
+      } else {
+         // Should be no error
+         if(nReturn) {
+            return -9; // Should not have got an error
+         }
+      }
+      if(Item.uDataType != QCBOR_TYPE_ARRAY) {
+         return -7;
+      }
+   }
+   int nReturn = QCBORDecode_Finish(&DC);
+   if(nReturn) {
+      return -3;
+   }
+   return 0;
+}
 
 
+int indeflen_nest_test()
+{
+   UsefulBuf_MakeStackUB(Storage, 50);
+   int i;
+   for(i=1; i < QCBOR_MAX_ARRAY_NESTING+4; i++) {
+      UsefulBufC Nested = make_nested_indefinite_arrays(i, Storage);
+      int nReturn = parse_indeflen_nested(Nested, i);
+      if(nReturn) {
+         return nReturn;
+      }
+   }
+   return 0;
+}
 
-static const uint8_t pIndefiniteLenString[] = {
-    0x81, // Array of length one
-    0x7f, // text string marked with indefinite length
-    0x65, 0x73, 0x74, 0x72, 0x65, 0x61, // first segment
-    0x64, 0x6d, 0x69, 0x6e, 0x67, // second segment
-    0xff // ending break
-};
-
-static const uint8_t pIndefiniteArray[] = {0x9f, 0x01, 0x82, 0x02, 0x03, 0xff};
 
 // [1, [2, 3]]
-
-
-//0x9f018202039f0405ffff
+static const uint8_t pIndefiniteArray[] = {0x9f, 0x01, 0x82, 0x02, 0x03, 0xff};
 
 int indefinite_length_decode_test()
 {
     UsefulBufC IndefLen = UsefulBuf_FromByteArrayLiteral(pIndefiniteArray);
-    
-    
+   
     // Decode it and see if it is OK
     UsefulBuf_MakeStackUB(MemPool, 200);
     QCBORDecodeContext DC;
@@ -1645,6 +1693,15 @@
     return 0;
 }
 
+
+static const uint8_t pIndefiniteLenString[] = {
+   0x81, // Array of length one
+   0x7f, // text string marked with indefinite length
+   0x65, 0x73, 0x74, 0x72, 0x65, 0x61, // first segment
+   0x64, 0x6d, 0x69, 0x6e, 0x67, // second segment
+   0xff // ending break
+};
+
 int indefinite_length_decode_string_test() {
     UsefulBufC IndefLen = UsefulBuf_FromByteArrayLiteral(pIndefiniteLenString);
     
diff --git a/test/qcbor_decode_tests.h b/test/qcbor_decode_tests.h
index 751da8b..52e64c5 100644
--- a/test/qcbor_decode_tests.h
+++ b/test/qcbor_decode_tests.h
@@ -161,6 +161,7 @@
 int indefinite_length_decode_test(void);
 int indefinite_length_decode_string_test(void);
 
+int indeflen_nest_test(void);
 
 int mempool_test(void);
 
diff --git a/test/run_tests.c b/test/run_tests.c
index 6b5b736..41f2d8d 100644
--- a/test/run_tests.c
+++ b/test/run_tests.c
@@ -112,6 +112,7 @@
 
 
 test_entry s_tests[] = {
+    TEST_ENTRY(indeflen_nest_test),
     TEST_ENTRY(EncodeRawTest),
     TEST_ENTRY(FloatValuesTest1),
     TEST_ENTRY(RTICResultsTest),