Example #1
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_extract_scalar_prefix),
        unit_test(test_extract_reference),
        unit_test_setup_teardown(test_map_iterators_from_rval_empty, test_setup, test_teardown),
        unit_test_setup_teardown(test_map_iterators_from_rval_literal, test_setup, test_teardown),
        unit_test_setup_teardown(test_map_iterators_from_rval_naked_list_var, test_setup, test_teardown),
        unit_test_setup_teardown(test_map_iterators_from_rval_naked_list_var_namespace, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_two_scalars_concat, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_two_scalars_nested, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_array_concat, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_array_with_scalar_arg, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_undefined, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_scalar_nested_inner_undefined, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_list_nested, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_promise_array_with_scalar_arg, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_promise_slist, test_setup, test_teardown),
        unit_test_setup_teardown(test_expand_promise_array_with_slist_arg, test_setup, test_teardown)
    };

    return run_tests(tests);
}
Example #2
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_failsafe),

        unit_test(test_bundle_redefinition),
        unit_test(test_bundle_reserved_name),
        unit_test(test_body_redefinition),
        unit_test(test_vars_multiple_types),
        unit_test(test_methods_invalid_arity),
        unit_test(test_promise_duplicate_handle),

        unit_test(test_policy_json_to_from),
        unit_test(test_policy_json_offsets),

        unit_test(test_util_bundle_qualified_name),
        unit_test(test_util_qualified_name_components),

        unit_test(test_constraint_comment_nonscalar),

        unit_test(test_promiser_empty_varref),

        unit_test(test_body_action_with_log_repaired_needs_log_string),
    };

    return run_tests(tests);
}
Example #3
0
int main()
{
    LogSetGlobalLevel(LOG_LEVEL_DEBUG);
    strcpy(CFWORKDIR, "data");

#if defined(__sun)
    VSYSTEMHARDCLASS = PLATFORM_CONTEXT_SOLARIS;
    VPSHARDCLASS = PLATFORM_CONTEXT_SOLARIS;
#elif defined(_AIX)
    VSYSTEMHARDCLASS = PLATFORM_CONTEXT_AIX;
    VPSHARDCLASS = PLATFORM_CONTEXT_AIX;
#elif defined(__linux__)
    VSYSTEMHARDCLASS = PLATFORM_CONTEXT_LINUX;
    VPSHARDCLASS = PLATFORM_CONTEXT_LINUX;
#endif

    PRINT_TEST_BANNER();
    tests_setup();
    const UnitTest tests[] =
    {
        unit_test(test_processes_monitor),
    };

    int ret = run_tests(tests);
    tests_teardown();
    return ret;
}
Example #4
0
int main()
{
    PRINT_TEST_BANNER();

    /* Don't miss the messages about GetProcessStartTime not implemented. */
    LogSetGlobalLevel(LOG_LEVEL_DEBUG);

    THIS_PID       = getpid();
    THIS_STARTTIME = GetProcessStartTime(THIS_PID);

    printf("This parent process has PID %jd and start_time %jd\n",
           (intmax_t) THIS_PID, (intmax_t) THIS_STARTTIME);

    const UnitTest tests[] =
    {
        unit_test(test_process_start_time),
        unit_test(test_process_state),
        unit_test(test_graceful_terminate)
    };

    int ret = run_tests(tests);

    /* Make sure no child is alive. */
    if (SPAWNED_PID > 0)
    {
        kill(SPAWNED_PID, SIGKILL);
    }

    return ret;
}
Example #5
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_prepend_scalar_idempotent),
        unit_test(test_length),
        unit_test(test_copy),
        unit_test(test_rval_to_scalar),
        unit_test(test_rval_to_scalar2),
        unit_test(test_rval_to_list),
        unit_test(test_rval_to_list2),
        unit_test(test_rval_to_fncall),
        unit_test(test_rval_to_fncall2),
        unit_test(test_last),
        unit_test(test_filter),
        unit_test(test_filter_everything),
        unit_test(test_reverse),
        unit_test(test_split_escaped),
        unit_test(test_split_long),
        unit_test(test_split_long_escaped),
        unit_test(test_new_parser_success),
        unit_test(test_new_parser_failure),
        unit_test(test_regex_split),
        unit_test(test_regex_split_too_few_chunks),
        unit_test(test_regex_split_too_many_chunks),
        unit_test(test_regex_split_empty_chunks),
        unit_test(test_regex_split_no_match),
        unit_test(test_regex_split_adjacent_separators),
        unit_test(test_regex_split_real_regex),
        unit_test(test_regex_split_overlapping_delimiters)
    };

    return run_tests(tests);
}
Example #6
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_prepend_scalar),
        unit_test(test_prepend_scalar_idempotent),
        unit_test(test_length),
        unit_test(test_copy),
        unit_test(test_rval_to_scalar),
        unit_test(test_rval_to_scalar2),
        unit_test(test_rval_to_list),
        unit_test(test_rval_to_list2),
        unit_test(test_rval_to_fncall),
        unit_test(test_rval_to_fncall2),
        unit_test(test_last),
        unit_test(test_filter),
        unit_test(test_filter_everything),
        unit_test(test_reverse),
        unit_test(test_new_parser_success),
        unit_test(test_new_parser_failure),
    };

    return run_tests(tests);
}
Example #7
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_new_delete),
        unit_test(test_object_duplicate_key),
        unit_test(test_show_string),
        unit_test(test_show_object_simple),
        unit_test(test_show_object_escaped),
        unit_test(test_show_object_numeric),
        unit_test(test_show_object_boolean),
        unit_test(test_show_object_compound),
        unit_test(test_show_object_compound_compact),
        unit_test(test_show_object_array),
        unit_test(test_show_array),
        unit_test(test_show_array_compact),
        unit_test(test_show_array_boolean),
        unit_test(test_show_array_numeric),
        unit_test(test_show_array_object),
        unit_test(test_show_array_empty),
        unit_test(test_show_array_nan),
        unit_test(test_show_array_infinity),
        unit_test(test_object_get_string),
        unit_test(test_object_get_array),
        unit_test(test_object_iterator),
        unit_test(test_iterator_current),
        unit_test(test_array_get_string),
        unit_test(test_array_iterator),
        unit_test(test_copy_compare),
        unit_test(test_select),
        unit_test(test_merge_array),
        unit_test(test_merge_object),
        unit_test(test_parse_empty_string),
        unit_test(test_parse_empty_containers),
        unit_test(test_parse_object_simple),
        unit_test(test_parse_array_simple),
        unit_test(test_parse_object_compound),
        unit_test(test_parse_object_diverse),
        unit_test(test_parse_array_object),
        unit_test(test_parse_good_numbers),
        unit_test(test_parse_bad_numbers),
        unit_test(test_parse_trim),
        unit_test(test_parse_array_extra_closing),
        unit_test(test_parse_array_diverse),
        unit_test(test_parse_bad_apple2),
        unit_test(test_parse_object_garbage),
        unit_test(test_parse_object_nested_garbage),
        unit_test(test_parse_array_garbage),
        unit_test(test_parse_array_nested_garbage),
        unit_test(test_parse_object_escaped),
        unit_test(test_parse_tzz_evil_key),
        unit_test(test_array_remove_range),
        unit_test(test_remove_key_from_object),
        unit_test(test_detach_key_from_object),
    };

    return run_tests(tests);
}
Example #8
0
int main()
{
    PRINT_TEST_BANNER();
    tests_setup();

    const UnitTest tests[] =
    {
        unit_test(test_cfreadline_valid),
        unit_test(test_cfreadline_corrupted),
    };

    PRINT_TEST_BANNER();
    int ret = run_tests(tests);

    tests_teardown();
    return ret;
}
Example #9
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_benchmark),

        unit_test(test_bundle_invalid_type),
        unit_test(test_bundle_args_invalid_type),
        unit_test(test_bundle_args_forgot_cp),
        unit_test(test_bundle_body_forgot_ob),
        unit_test(test_bundle_invalid_promise_type),
        unit_test(test_bundle_body_wrong_promise_type_token),
        unit_test(test_bundle_body_wrong_statement),
        unit_test(test_bundle_body_forgot_semicolon),
        unit_test(test_bundle_body_promiser_statement_contains_colon),
        unit_test(test_bundle_body_promiser_statement_missing_assign),
        unit_test(test_bundle_body_promisee_missing_arrow),
        unit_test(test_bundle_body_promiser_wrong_constraint_token),
        unit_test(test_bundle_body_promiser_unknown_constraint_id),
        unit_test(test_bundle_body_promiser_forgot_colon),
        unit_test(test_bundle_body_promisee_no_colon_allowed),
        unit_test(test_bundle_body_forget_cb_eof),
        unit_test(test_bundle_body_forget_cb_body),
        unit_test(test_bundle_body_forget_cb_bundle),
        unit_test(test_body_edit_line_common_constraints),
        unit_test(test_body_edit_xml_common_constraints),

        unit_test(test_body_invalid_type),
        unit_test(test_body_selection_wrong_token),
        unit_test(test_body_selection_forgot_semicolon),
        unit_test(test_body_selection_unknown_selection_id),
        unit_test(test_body_body_forget_cb_eof),
        unit_test(test_body_body_forget_cb_body),
        unit_test(test_body_body_forget_cb_bundle),

        unit_test(test_promise_promiser_nonscalar),

        unit_test(test_constraint_ifvarclass_invalid),

        unit_test(test_rval_list_forgot_colon),
        unit_test(test_rval_list_wrong_input_type),
        unit_test(test_rval_list_forgot_cb_semicolon),
        unit_test(test_rval_list_forgot_cb_colon),
        unit_test(test_rval_function_forgot_colon),
        unit_test(test_rval_function_wrong_input_type),
        unit_test(test_rval_function_forgot_cp_semicolon),
        unit_test(test_rval_function_forgot_cp_colon),
        unit_test(test_rval_wrong_input_type),

        unit_test(test_no_bundle_or_body_keyword)

    };

    return run_tests(tests);
}
Example #10
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
          unit_test(test_command_parser)
    };

    return run_tests(tests);
}
Example #11
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_RemoveKeys)
    };

    return run_tests(tests);
}
Example #12
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
          unit_test(test_generateAvahiConfig)
    };

    return run_tests(tests);
}
Example #13
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_validation),
        unit_test(test_mode)
    };
    return run_tests(tests);
}
Example #14
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_create_destroy),
    };

    return run_tests(tests);
}
Example #15
0
int main()
{
    const UnitTest tests[] =
    {
        unit_test(test_has_regex_meta_chars),
    };

    PRINT_TEST_BANNER();
    return run_tests(tests);
}
Example #16
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_ParseHostPort)
    };

    return run_tests(tests);
}
Example #17
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_basics),
        unit_test(test_destroy)
    };
    return run_tests(tests);
}
Example #18
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_set_names),
    };

    return run_tests(tests);
}
Example #19
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_match_region),
    };

    return run_tests(tests);
}
Example #20
0
int main()
{
    const UnitTest tests[] =
{
        unit_test(test_name_join),
    };

    PRINT_TEST_BANNER();
    return run_tests(tests);
}
Example #21
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_str_to_service_policy),
        unit_test(test_double_from_string),
    };

    return run_tests(tests);
}
Example #22
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_creation_destruction)
        , unit_test(test_comparison)
    };

    return run_tests(tests);
}
Example #23
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_new_destroy),
        unit_test(test_load)
    };

    return run_tests(tests);
}
Example #24
0
/*
 * Main routine
 * Notice the calls to both setup and teardown.
 */
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_key_basic),
        unit_test(test_key_hash)
    };
    OpenSSL_add_all_digests();
    int result = run_tests(tests);
    return result;
}
Example #25
0
int main()
{
    const UnitTest tests[] =
    {
        unit_test(test_get_time_slot),
        unit_test(test_measurement_slot_start),
        unit_test(test_measurement_slot_time)
    };

    PRINT_TEST_BANNER();
    return run_tests(tests);
}
Example #26
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_set_port),
        unit_test(test_set_host),
        unit_test(test_log_level),
    };

    return run_tests(tests);
}
Example #27
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_default_ns),
        unit_test(test_ns),
        unit_test(test_class_ref),
    };

    return run_tests(tests);
}
Example #28
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_full_text_match),
        unit_test(test_full_text_match2),
        unit_test(test_block_text_match),
        unit_test(test_block_text_match2),
    };

    return run_tests(tests);
}
Example #29
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_prepend_item),
        unit_test(test_list_len),
        unit_test(test_list_compare),
        unit_test(test_split_string)
    };

    return run_tests(tests);
}
Example #30
0
int main()
{
    PRINT_TEST_BANNER();
    const UnitTest tests[] =
    {
        unit_test(test_purge_old_connections_nochange),
        unit_test(test_purge_old_connections_purge_first),
        unit_test(test_purge_old_connections_purge_middle),
        unit_test(test_purge_old_connections_purge_last)
    };

    return run_tests(tests);
}