+ NextTokenizerIterateBuf(Buf, 1);
+ FreeStrBuf(&Buf);
+}
+
+static void TestNextTokenizer_Sequence(void)
+{
+ StrBuf *Buf;
+ char *teststring = "40:24524,24662,24673,27869:27935,28393,28426,31247:31258,31731,31749,31761,31778,31782,31801:31803,31813,31904,31915,33708,33935,34619,34672,34720:34723,34766,34835,37594,38854,39235,39942,40030,40142,40520,40815,40907,41201,41578,41781,41954,42292,43110,43565,43801,43998,44180,44241,44295,44401,44561,44635,44798,44861,44946,45022,45137:45148,45166,45179,45707,47114,47141:47157,47194,47314,47349,47386,47489,47496,47534:47543,54460,54601,54637:54652";
+ Buf = NewStrBufPlain(teststring, -1);
+ NextTokenizerIterateBuf(Buf, 67);
+ FreeStrBuf(&Buf);
+}
+
+
+
+static void NextLineterateBuf(StrBuf *Buf, int NLines)
+{
+ int n = 0;
+ const char *pCh = NULL;
+ StrBuf *OneLine;
+ StrBuf *ConcatenatedLines;
+ long CountTokens = 0;
+
+ TestRevalidateStrBuf(Buf);
+
+ OneLine = NewStrBuf();
+ ConcatenatedLines = NewStrBuf();
+
+ if (!Quiet) printf("\n");
+
+ if (StrLength(Buf) > 0)
+ do
+ {
+ n = StrBufSipLine(OneLine, Buf, &pCh);
+
+ CountTokens++;
+
+ if (!Quiet) printf("Line: >%s< >%s<\n",
+ ChrPtr(OneLine),
+ ((pCh != NULL) && (pCh != StrBufNOTNULL))? pCh : "N/A");
+ TestRevalidateStrBuf(OneLine);
+ CU_ASSERT(CountTokens <= NLines);
+ StrBufAppendBuf(ConcatenatedLines, OneLine, 0);
+
+ if ((pCh == StrBufNOTNULL) &&
+ (*(ChrPtr(Buf) + StrLength(Buf) - 1) != '\n'))
+ {
+ }
+ else
+ StrBufAppendBufPlain(ConcatenatedLines, HKEY("\n"), 0);
+
+ }
+ while ((pCh != StrBufNOTNULL) &&
+ (pCh != NULL));
+
+
+ if (!Quiet) printf("\n\nTemplate: >%s<\n", ChrPtr(Buf));
+ if (!Quiet) printf("\n\nAfter: >%s<\n", ChrPtr(ConcatenatedLines));
+ CU_ASSERT_NSTRING_EQUAL(ChrPtr(ConcatenatedLines),
+ ChrPtr(Buf),
+ StrLength(Buf));
+
+ FreeStrBuf(&OneLine);
+ FreeStrBuf(&ConcatenatedLines);
+}
+
+
+static void TestNextLine_Empty(void)
+{
+ StrBuf *Buf;
+
+ Buf = NewStrBufPlain(HKEY(""));
+ NextLineterateBuf(Buf, 0);