Go to the source code of this file.
|
typedef void(* | OutputStringCB) (const char *szString, void *pOutCtx, int bNewline) |
| Type for function to output a text string. More...
|
|
◆ OutputStringCB
typedef void(* OutputStringCB) (const char *szString, void *pOutCtx, int bNewline) |
Type for function to output a text string.
- Parameters
-
[in] | szString | The string to output |
[in] | pOutCtx | A context pointer; NULL if not needed |
[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 pOutCtx as shown in the example code below. This code is for Linux where the newline is a \n. Windows usually prefers \r\n.
static void fputs_wrapper(const char *szString, void *pOutCtx, int bNewLine)
{
fputs(szString, (FILE *)pOutCtx);
if(bNewLine) {
fputs("\n", pOutCtx);
}
}
Definition at line 42 of file run_tests.h.
◆ RunTests()
int RunTests |
( |
const char * |
szTestNames[], |
|
|
OutputStringCB |
pfOutput, |
|
|
void * |
pOutCtx, |
|
|
int * |
pNumTestsRun |
|
) |
| |
Runs the QCBOR tests.
- Parameters
-
[in] | szTestNames | An argv-style list of test names to run. If empty, all are run. |
[in] | pfOutput | Function that is called to output text strings. |
[in] | pOutCtx | Context pointer passed to output function. |
[out] | pNumTestsRun | Returns the number of tests run. May be NULL. |
- Returns
- The number of tests that failed. Zero means overall success.
◆ PrintSizes()
Print sizes of encoder / decoder contexts.
- Parameters
-
[in] | pfOutput | Function that is called to output text strings. |
[in] | pOutCtx | Context pointer passed to output function. |