Benchmark test case array needed to be terminated with {NULL,0,NULL}. Noted that in comments.
This commit is contained in:
parent
21ec962d76
commit
771de6f98b
3 changed files with 10 additions and 4 deletions
|
|
@ -70,6 +70,6 @@ benchmark: t_benchmark.o libhammer.a
|
|||
test: test_suite
|
||||
./test_suite -v
|
||||
|
||||
test_suite: test_suite.o $(TESTS) libhammer.a
|
||||
test_suite: test_suite.o libhammer.a
|
||||
$(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
/*
|
||||
Usage:
|
||||
Create your parser (i.e., HParser*), and then call
|
||||
Create your parser (i.e., const HParser*), and an array of test cases
|
||||
(i.e., HParserTestcase[], terminated by { NULL, 0, NULL }) and then call
|
||||
|
||||
HBenchmarkResults* results = h_benchmark(parser, testcases);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ HParserTestcase testcases[] = {
|
|||
{(unsigned char*)"1,2,3", 5, "(u0x31 u0x32 u0x33)"},
|
||||
{(unsigned char*)"1,3,2", 5, "(u0x31 u0x33 u0x32)"},
|
||||
{(unsigned char*)"1,3", 3, "(u0x31 u0x33)"},
|
||||
{(unsigned char*)"3", 1, "(u0x33)"}
|
||||
{(unsigned char*)"3", 1, "(u0x33)"},
|
||||
{ NULL, 0, NULL }
|
||||
};
|
||||
|
||||
void test_benchmark_1() {
|
||||
|
|
@ -13,5 +14,9 @@ void test_benchmark_1() {
|
|||
|
||||
HBenchmarkResults *res = h_benchmark(parser, testcases);
|
||||
h_benchmark_report(stderr, res);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
test_benchmark_1();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue