Get rid of extra spaces, minor documentation improvements, readme additions
diff --git a/test/UsefulBuf_Tests.c b/test/UsefulBuf_Tests.c
index 2b9a28e..cfa1262 100644
--- a/test/UsefulBuf_Tests.c
+++ b/test/UsefulBuf_Tests.c
@@ -403,11 +403,11 @@
if(!UsefulBuf_IsNULLC(UsefulBuf_Tail(xxyy, 5))) {
return "tail should have failed";
}
-
+
if(!UsefulBuf_IsNULLC(UsefulBuf_Tail(NULLUsefulBufC, 0))) {
return "tail of NULLUsefulBufC is not NULLUsefulBufC";
}
-
+
const UsefulBufC TailResult = UsefulBuf_Tail((UsefulBufC){NULL, 100}, 99);
if(TailResult.ptr != NULL || TailResult.len != 1) {
return "tail of NULL and length incorrect";
diff --git a/test/qcbor_decode_tests.h b/test/qcbor_decode_tests.h
index a7ee0b5..2b09c55 100644
--- a/test/qcbor_decode_tests.h
+++ b/test/qcbor_decode_tests.h
@@ -141,9 +141,9 @@
Parses all possible inputs that are two bytes long. Main point
is that the test doesn't crash as it doesn't evaluate the
input for correctness in any way.
-
+
(Parsing all possible 3 byte strings takes too long on all but
- very fast machines).
+ very fast machines).
*/
int ComprehensiveInputTest(void);
diff --git a/test/qcbor_encode_tests.c b/test/qcbor_encode_tests.c
index 6153b24..2a22cf1 100644
--- a/test/qcbor_encode_tests.c
+++ b/test/qcbor_encode_tests.c
@@ -1405,7 +1405,7 @@
if(CheckResults(Encoded, spExpectedBstrWrap)) {
return -2;
}
-
+
/* Another test; see about handling length calculation */
QCBOREncode_Init(&EC, (UsefulBuf){NULL, INT32_MAX});
QCBOREncode_OpenArray(&EC);
@@ -1756,7 +1756,7 @@
if(QCBORDecode_Finish(&DC)) {
return -16;
}
-
+
return 0;
}
@@ -1870,12 +1870,12 @@
int EncodeErrorTests()
{
QCBOREncodeContext EC;
-
-
+
+
// ------ Test for QCBOR_ERR_BUFFER_TOO_LARGE ------
// Do all of these tests with NULL buffers so no actual large allocations are neccesary
UsefulBuf Buffer = (UsefulBuf){NULL, UINT32_MAX};
-
+
// First verify no error from a big buffer
QCBOREncode_Init(&EC, Buffer);
QCBOREncode_OpenArray(&EC);
@@ -1898,7 +1898,7 @@
if(QCBOREncode_FinishGetSize(&EC, &xx) != QCBOR_ERR_BUFFER_TOO_LARGE) {
return -2;
}
-
+
// Third, fit an array in exactly at max position allowed
QCBOREncode_Init(&EC, Buffer);
QCBOREncode_OpenArray(&EC);
@@ -1934,8 +1934,8 @@
// Now just 1 byte over, see that it fails
return -4;
}
-
-
+
+
// ----- QCBOR_ERR_ARRAY_NESTING_TOO_DEEP -------
QCBOREncode_Init(&EC, Large);
for(int i = QCBOR_MAX_ARRAY_NESTING; i > 0; i--) {
@@ -1960,8 +1960,8 @@
// One more level to cause error
return -6;
}
-
-
+
+
// ------ QCBOR_ERR_TOO_MANY_CLOSES --------
QCBOREncode_Init(&EC, Large);
for(int i = QCBOR_MAX_ARRAY_NESTING; i > 0; i--) {
@@ -1974,8 +1974,8 @@
// One more level to cause error
return -7;
}
-
-
+
+
// ------ QCBOR_ERR_CLOSE_MISMATCH --------
QCBOREncode_Init(&EC, Large);
QCBOREncode_OpenArray(&EC);
@@ -1998,7 +1998,7 @@
// One more level to cause error
return -9;
}
-
+
/* QCBOR_ERR_ARRAY_TOO_LONG is not tested here as
it would require a 64KB of RAM to test */
diff --git a/test/run_tests.c b/test/run_tests.c
index c2816ba..6c09b09 100644
--- a/test/run_tests.c
+++ b/test/run_tests.c
@@ -209,7 +209,7 @@
if(pfOutput) {
(*pfOutput)(" FAILED (returned ", poutCtx, 0);
(*pfOutput)(szTestResult, poutCtx, 0);
- (*pfOutput)(")\n", poutCtx, 1);
+ (*pfOutput)(")", poutCtx, 1);
}
nTestsFailed++;
} else {
diff --git a/test/run_tests.h b/test/run_tests.h
index 438d55e..153107c 100644
--- a/test/run_tests.h
+++ b/test/run_tests.h
@@ -33,8 +33,9 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============================================================================*/
-
-
+/**
+ @file run_tests.h
+*/
/**
@brief Type for function to output a text string
@@ -44,9 +45,12 @@
@param[in] bNewline If non-zero, output a newline after the string
This is a prototype of a function to be passed to RunTests() to
- output text strings. This can be implemented with stdio (if
- available) using a straight call to fputs() where the FILE *
- is passed as the ctx.
+ output text strings.
+
+ This can be implemented with stdio (if available) using a straight
+ call to fputs() where the FILE * is passed as the pOutCtx as shown in
+ the example code below. This code is for Linux where the newline is
+ a \\n. Windows usually prefers \\r\\n.
@code
static void fputs_wrapper(const char *szString, void *pOutCtx, int bNewLine)