示例#1
0
void
TestJson_run_tests() {
    int num_tests = 107;
#ifndef LUCY_VALGRIND
    num_tests += 28; // FIXME: syntax errors leak memory.
#endif
    TestBatch *batch = TestBatch_new(num_tests);
    TestBatch_Plan(batch);

    // Test tolerance, then liberalize for testing.
    test_tolerance(batch);
    Json_set_tolerant(true);

    test_to_and_from(batch);
    test_escapes(batch);
    test_numbers(batch);
    test_spew_and_slurp(batch);
    test_integers(batch);
    test_floats(batch);
    test_max_depth(batch);
    test_illegal_keys(batch);

#ifndef LUCY_VALGRIND
    test_syntax_errors(batch);
#endif

    DECREF(batch);
}
示例#2
0
文件: TestJson.c 项目: rectang/lucy
void
TestJson_Run_IMP(TestJson *self, TestBatchRunner *runner) {
    uint32_t num_tests = 105;
#ifndef LUCY_VALGRIND
    num_tests += 28; // FIXME: syntax errors leak memory.
#endif
    TestBatchRunner_Plan(runner, (TestBatch*)self, num_tests);

    // Test tolerance, then liberalize for testing.
    test_tolerance(runner);
    Json_set_tolerant(true);

    test_to_and_from(runner);
    test_escapes(runner);
    test_numbers(runner);
    test_spew_and_slurp(runner);
    test_integers(runner);
    test_floats(runner);
    test_max_depth(runner);

#ifndef LUCY_VALGRIND
    test_syntax_errors(runner);
#endif
}