-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.c
46 lines (36 loc) · 890 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* main.c
*
* Copyright 2019-2021, Laurence Lundblade
*
* SPDX-License-Identifier: BSD-3-Clause
*
* See BSD-3-Clause license in README.md.
*
* Created 4/21/2019.
*/
#include <stdio.h>
#include "run_tests.h"
#include <string.h>
#include <stdlib.h>
/*
This is an implementation of OutputStringCB built using stdio. If
you don't have stdio, replaces this.
*/
static void fputs_wrapper(const char *szString, void *pOutCtx, int bNewLine)
{
fputs(szString, (FILE *)pOutCtx);
if(bNewLine) {
fputs("\n", pOutCtx);
}
}
int main(int argc, const char * argv[])
{
int return_value;
// This call prints out sizes of data structures to remind us
// to keep them small.
PrintSizesCToken(&fputs_wrapper, stdout);
// This runs all the tests
return_value = RunTestsCToken(argv+1, &fputs_wrapper, stdout, NULL);
return return_value;
}