Example #1
0
int main(int argc, char *argv[])
{
    apr_pool_t *p;
    unsigned i, plan = 0;
    dAT;
    at_test_t test_list [] = {
        {"version_string", version_string, 2, "1"},
        {"version_type", version_type, 4}
    };

    apr_initialize();
    atexit(apr_terminate);

    apr_pool_create(&p, NULL);

    AT = at_create(p, 0, at_report_stdout_make(p)); 

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        plan += test_list[i].plan;

    AT_begin(plan);

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        AT_run(&test_list[i]);

    AT_end();

    return 0;
}
Example #2
0
int main(int argc, char *argv[])
{
    unsigned i, plan = 0;
    dAT;
    at_test_t test_list [] = {
        { dT(jar_make, 14) },
        { dT(jar_get_rfc, 6), "1 3 5" },
        { dT(jar_get_ns, 10) },
        { dT(netscape_cookie, 7) },
        { dT(rfc_cookie, 6) },
    };

    apr_initialize();
    atexit(apr_terminate);

    apr_pool_create(&p, NULL);

    AT = at_create(p, 0, at_report_stdout_make(p));

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        plan += test_list[i].plan;

    AT_begin(plan);

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        AT_run(&test_list[i]);

    AT_end();

    return 0;
}
Example #3
0
int main(int argc, char *argv[])
{
    unsigned i, plan = 0;
    dAT;
    at_test_t test_list [] = {
        dT(request_make, 3),
        dT(request_args_get, 8),
        dT(params_as, 3),
        dT(string_decoding_in_place, 8),
        dT(header_attributes, 13),
        dT(make_param, 8),
        dT(quote_strings, 24),
    };

    apr_initialize();
    atexit(apr_terminate);
    apr_pool_create(&p, NULL);

    apreq_initialize(p);

    AT = at_create(p, 0, at_report_stdout_make(p));
    AT_trace_on();
    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        plan += test_list[i].plan;

    AT_begin(plan);

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        AT_run(&test_list[i]);

    AT_end();

    return 0;
}
Example #4
0
File: util.c Project: LuaDist/apreq
int main(int argc, char *argv[])
{
    unsigned i, plan = 0;
    apr_pool_t *p;
    dAT;
    at_test_t test_list [] = {
        { dT(test_atoi64f, 9) },
        { dT(test_atoi64t, 9) },
        { dT(test_index, 6) },
        { dT(test_decode, 7) },
        { dT(test_charset_divine, 6) },
        { dT(test_decodev, 6) },
        { dT(test_encode, 0) },
        { dT(test_cp1252_to_utf8, 14) },
        { dT(test_quote, 8) },
        { dT(test_quote_once, 18), },
        { dT(test_join, 0) },
        { dT(test_brigade_fwrite, 0) },
        { dT(test_file_mktemp, 0) },
        { dT(test_header_attribute, 6) },
        { dT(test_brigade_concat, 0) },
    };

    apr_initialize();
    atexit(apr_terminate);

    apr_pool_create(&p, NULL);

    AT = at_create(p, 0, at_report_stdout_make(p));

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        plan += test_list[i].plan;

    AT_begin(plan);

    for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
        AT_run(&test_list[i]);

    AT_end();

    return 0;
}