Esempio n. 1
0
int
main (int argc, char **argv)
{
	g_test_init (&argc, &argv, NULL);

	/* only critical and error are fatal */
	g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);

	/* log everything */
	g_setenv ("G_MESSAGES_DEBUG", "all", FALSE);

	/* tests go here */
	g_test_add_func ("/wac/firmware{parse}", fu_wac_firmware_parse_func);
	return g_test_run ();
}
Esempio n. 2
0
int main (int argc, char **argv)
{
  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/Utils/safename_returns_foobar", test_safename1);
  g_test_add_func ("/Utils/safename_returns_html_entities", test_safename2);
  g_test_add_func ("/Utils/safename_returns_null", test_safename3);

  g_test_add_func ("/Utils/application_menu_with_prefix", test_application_menu_with_prefix);
  g_test_add_func ("/Utils/application_menu_without_prefix", test_application_menu_without_prefix);

  g_test_add_func ("/Context/set_terminal_cmd", test_set_terminal_cmd);
  g_test_add_func ("/Context/set_desktop_flag", test_set_desktop_flag);
  g_test_add_func ("/Context/add_desktop_flag", test_add_desktop_flag);

  g_test_add_func ("/Context/set_persistent_true", test_persistent_true);
  g_test_add_func ("/Context/set_persistent_false", test_persistent_false);



  g_test_set_nonfatal_assertions ();

  return g_test_run();
}
Esempio n. 3
0
int
main (int    argc,
      char** argv)
{
    /* libSoup uses threads, therefore if WebKit is built with libSoup
       or Midori is using it, we need to initialize threads. */
    if (!g_thread_supported ()) g_thread_init (NULL);
    g_test_init (&argc, &argv, NULL);
    gtk_init_check (&argc, &argv);
    sokoke_register_stock_items ();

    g_test_add_func ("/browser/create", browser_create);

    return g_test_run ();
}
Esempio n. 4
0
int main(int argc, char *argv[])
{
    int nreaders = 1;
    int duration = 1;

    qemu_mutex_init(&counts_mutex);
    if (argc >= 2 && argv[1][0] == '-') {
        g_test_init(&argc, &argv, NULL);
        if (g_test_quick()) {
            g_test_add_func("/rcu/torture/1reader", gtest_stress_1_1);
            g_test_add_func("/rcu/torture/10readers", gtest_stress_10_1);
        } else {
            g_test_add_func("/rcu/torture/1reader", gtest_stress_1_5);
            g_test_add_func("/rcu/torture/10readers", gtest_stress_10_5);
        }
        return g_test_run();
    }

    if (argc >= 2) {
        nreaders = strtoul(argv[1], NULL, 0);
    }
    if (argc > 3) {
        duration = strtoul(argv[3], NULL, 0);
    }
    if (argc < 3 || strcmp(argv[2], "stress") == 0) {
        stresstest(nreaders, duration);
    } else if (strcmp(argv[2], "rperf") == 0) {
        rperftest(nreaders, duration);
    } else if (strcmp(argv[2], "uperf") == 0) {
        uperftest(nreaders, duration);
    } else if (strcmp(argv[2], "perf") == 0) {
        perftest(nreaders, duration);
    }
    usage(argc, argv);
    return 0;
}
Esempio n. 5
0
int
main (int argc,
    char **argv)
{
  int result;

  test_init (argc, argv);

  g_test_add_func ("/parsers", test_parsers);

  result = g_test_run ();
  test_deinit ();

  return result;
}
int
main (int argc,
    char **argv)
{
  int result;

  test_init (argc, argv);

  g_test_add_func ("/live-search", test_live_search);

  result = g_test_run ();
  test_deinit ();

  return result;
}
Esempio n. 7
0
int
main (int argc, char *argv[])
{
  gchar *path;

  path = g_mkdtemp (g_strdup ("app_monitor_XXXXXX"));
  g_setenv ("XDG_DATA_DIRS", path, TRUE);
  g_setenv ("XDG_DATA_HOME", path, TRUE);

  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/monitor/app", test_app_monitor);

  return g_test_run ();
}
Esempio n. 8
0
int main(int argc, char** argv)
{
    SoupServer* server;
    SoupURI* soup_uri;

    g_thread_init(NULL);
    gtk_test_init(&argc, &argv, NULL);

    /* Hopefully make test independent of the path it's called from. */
    while (!g_file_test ("WebKit/gtk/tests/resources/test.html", G_FILE_TEST_EXISTS)) {
        char path_name[PATH_MAX];

        g_chdir("..");

        g_assert(!g_str_equal(getcwd(path_name, PATH_MAX), "/"));
    }

    g_chdir("WebKit/gtk/tests/resources/");

    server = soup_server_new(SOUP_SERVER_PORT, 0, NULL);
    soup_server_run_async(server);

    soup_server_add_handler(server, NULL, server_callback, NULL, NULL);

    soup_uri = soup_uri_new("http://127.0.0.1/");
    soup_uri_set_port(soup_uri, soup_server_get_port(server));

    base_uri = soup_uri_to_string(soup_uri, FALSE);
    soup_uri_free(soup_uri);

    g_test_bug_base("https://bugs.webkit.org/");
    g_test_add_func("/webkit/webview/icon-uri", test_webkit_web_view_icon_uri);
    g_test_add_func("/webkit/webview/adjustments", test_webkit_web_view_adjustments);

    return g_test_run ();
}
Esempio n. 9
0
File: test-adim.c Progetto: bert/adg
int
main(int argc, char *argv[])
{
    adg_test_init(&argc, &argv);

    adg_test_add_object_checks("/adg/adim/type/object", ADG_TYPE_ADIM);
    adg_test_add_entity_checks("/adg/adim/type/entity", ADG_TYPE_ADIM);

    adg_test_add_global_space_checks("/adg/adim/behavior/global-space",
                                     adg_adim_new_full_explicit(1, 2, 3, 4,
                                                                9, 6, 7, 8,
                                                                9, 10));
    adg_test_add_local_space_checks("/adg/adim/behavior/local-space",
                                    adg_adim_new_full_explicit(4, 3, 2, 1,
                                                               8, 7, 6, 9,
                                                               10, 9));

    g_test_add_func("/adg/adim/property/org1", _adg_property_org1);
    g_test_add_func("/adg/adim/property/org2", _adg_property_org2);
    g_test_add_func("/adg/adim/property/has-extension1", _adg_property_has_extension1);
    g_test_add_func("/adg/adim/property/has-extension2", _adg_property_has_extension2);

    return g_test_run();
}
Esempio n. 10
0
int
main(int argc, char *argv[])
{
#if (!GLIB_CHECK_VERSION (2, 36, 0))
  g_type_init ();
#endif

  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/testmemorybuffer/CreateAndDestroy", test_create_and_destroy);
  g_test_add_func ("/testmemorybuffer/CreateAndDestroyLarge", test_create_and_destroy_large);
  g_test_add_func ("/testmemorybuffer/CreateAndDestroyUnlimited", test_create_and_destroy_default);
  g_test_add_func ("/testmemorybuffer/CreateAndDestroyExternal", test_create_and_destroy_external);
  g_test_add_func ("/testmemorybuffer/CreateAndDestroyUnowned", test_create_and_destroy_unowned);
  g_test_add_func ("/testmemorybuffer/OpenAndClose", test_open_and_close);
  g_test_add_func ("/testmemorybuffer/ReadAndWrite", test_read_and_write);
  g_test_add_func ("/testmemorybuffer/ReadAndWriteUnlimited", test_read_and_write_default);
  g_test_add_func ("/testmemorybuffer/ReadAndWriteExternal", test_read_and_write_external);

  return g_test_run ();
}
Esempio n. 11
0
int main(int argc, char **argv)
{
    qemu_init_main_loop(&error_abort);

    g_test_init(&argc, &argv, NULL);
    g_test_add_func("/single/success", test_single_job_success);
    g_test_add_func("/single/failure", test_single_job_failure);
    g_test_add_func("/single/cancel", test_single_job_cancel);
    g_test_add_func("/pair/success", test_pair_jobs_success);
    g_test_add_func("/pair/failure", test_pair_jobs_failure);
    g_test_add_func("/pair/cancel", test_pair_jobs_cancel);
    g_test_add_func("/pair/fail-cancel-race", test_pair_jobs_fail_cancel_race);
    return g_test_run();
}
Esempio n. 12
0
int main(int argc, char **argv)
{
    g_test_init(&argc, &argv, NULL);

    g_test_add_func("/visitor/clone/struct", test_clone_struct);
    g_test_add_func("/visitor/clone/alternate", test_clone_alternate);
    g_test_add_func("/visitor/clone/native_list", test_clone_native_list);
    g_test_add_func("/visitor/clone/empty", test_clone_empty);
    g_test_add_func("/visitor/clone/complex1", test_clone_complex1);
    g_test_add_func("/visitor/clone/complex2", test_clone_complex2);
    g_test_add_func("/visitor/clone/complex3", test_clone_complex3);

    return g_test_run();
}
int main(int argc, char **argv) {

	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");
	chassis_log *log = NULL;
	log = chassis_log_new();
	log->min_lvl = G_LOG_LEVEL_DEBUG; /* display messages while parsing or loading plugins */
	g_log_set_default_handler(chassis_log_func, log);
	log->log_file_fd = STDERR_FILENO;
	g_log_set_always_fatal(G_LOG_FATAL_MASK);
	g_test_add_func("/core/test_update_status_from_up_to_down",test_update_status_from_up_to_down);

	gint ret = g_test_run();

	return ret;
}
Esempio n. 14
0
int main(int argc, char **argv) {
	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");

	g_test_add_func("/core/network_address_new", t_network_address_new);
	g_test_add_func("/core/network_address_set", t_network_address_set);
	g_test_add_func("/core/network_address_tostring_ipv4", t_network_address_tostring_ipv4);
	g_test_add_func("/core/network_address_tostring_ipv6", t_network_address_tostring_ipv6);
	g_test_add_func("/core/network_address_tostring_unix", t_network_address_tostring_unix);
	g_test_add_func("/core/network_address_resolve", t_network_address_resolve);
	g_test_add_func("/core/network_address_resolve_ipv6", t_network_address_resolve_ipv6);

	return g_test_run();
}
int main(int argc, char **argv) {

	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");
	chassis_log *log = NULL;
	log = chassis_log_new();
	log->min_lvl = G_LOG_LEVEL_DEBUG; /* display messages while parsing or loading plugins */
	g_log_set_default_handler(chassis_log_func, log);
	log->log_file_fd = STDERR_FILENO;

	g_test_add_func("/core/test_admin_pool_config_mange",test_admin_pool_config_mange);

	gint ret = g_test_run();
	chassis_log_free(log);
	return ret;
}
Esempio n. 16
0
static void __attribute__ ((constructor)) init()
{
	g_test_add_func("/mountinfo/parse_mountinfo_entry/sysfs",
			test_parse_mountinfo_entry__sysfs);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/snapd-ns",
			test_parse_mountinfo_entry__snapd_ns);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/snapd-mnt",
			test_parse_mountinfo_entry__snapd_mnt);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/garbage",
			test_parse_mountinfo_entry__garbage);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/no_tags",
			test_parse_mountinfo_entry__no_tags);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/one_tags",
			test_parse_mountinfo_entry__one_tag);
	g_test_add_func("/mountinfo/parse_mountinfo_entry/two_tags",
			test_parse_mountinfo_entry__two_tags);
	g_test_add_func("/mountinfo/accessor_funcs", test_accessor_funcs);
}
int
main (int   argc,
      char *argv[])
{
  GError *error;
  gint ret;

  g_type_init ();
  g_thread_init (NULL);
  g_test_init (&argc, &argv, NULL);

  /* all the tests rely on a shared main loop */
  loop = g_main_loop_new (NULL, FALSE);

  /* all the tests use a session bus with a well-known address that we can bring up and down
   * using session_bus_up() and session_bus_down().
   */
  g_unsetenv ("DISPLAY");
  g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);

  session_bus_up ();

  /* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return
   * until one can connect to the bus but that's not how things work right now
   */
  usleep (500 * 1000);

  /* this is safe; testserver will exit once the bus goes away */
  g_assert (g_spawn_command_line_async (SRCDIR "/gdbus-testserver.py", NULL));

  /* wait for the service to come up */
  usleep (500 * 1000);

  /* Create the connection in the main thread */
  error = NULL;
  c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
  g_assert_no_error (error);
  g_assert (c != NULL);

  g_test_add_func ("/gdbus/connection-loss", test_connection_loss);

  ret = g_test_run();

  g_object_unref (c);

  return ret;
}
Esempio n. 18
0
int main(int argc, char* argv[]) {
  g_test_init(&argc, &argv, NULL);
  g_test_add_func("/bmi/grid/rank", &test_bmi_grid_rank);
  g_test_add_func("/bmi/grid/size", &test_bmi_grid_size);
  g_test_add_func("/bmi/grid/type", &test_bmi_grid_type);
  g_test_add_func("/bmi/grid/shape", &test_bmi_grid_shape);
  g_test_add_func("/bmi/grid/spacing", &test_bmi_grid_spacing);
  g_test_add_func("/bmi/grid/origin", &test_bmi_grid_origin);

  return g_test_run();
}
Esempio n. 19
0
int main(int argc, char **argv)
{
    g_test_init(&argc, &argv, NULL);

    module_call_init(MODULE_INIT_QOM);
    type_register_static(&dummy_info);
    type_register_static(&dummy_dev_info);
    type_register_static(&dummy_bus_info);
    type_register_static(&dummy_backend_info);

    g_test_add_func("/qom/proplist/createlist", test_dummy_createlist);
    g_test_add_func("/qom/proplist/createv", test_dummy_createv);
    g_test_add_func("/qom/proplist/createcmdline", test_dummy_createcmdl);
    g_test_add_func("/qom/proplist/badenum", test_dummy_badenum);
    g_test_add_func("/qom/proplist/getenum", test_dummy_getenum);
    g_test_add_func("/qom/proplist/iterator", test_dummy_iterator);
    g_test_add_func("/qom/proplist/class_iterator", test_dummy_class_iterator);
    g_test_add_func("/qom/proplist/delchild", test_dummy_delchild);
    g_test_add_func("/qom/resolve/partial", test_qom_partial_path);

    return g_test_run();
}
Esempio n. 20
0
int main(int argc, char **argv)
{
#if !GLIB_CHECK_VERSION(2, 32, 0)
  if (!g_thread_supported())
    g_thread_init(NULL);
#endif

#if !GLIB_CHECK_VERSION(2, 36, 0)
  g_type_init();
#endif

  g_test_init(&argc, &argv, NULL);

  g_test_add_func("/rsa", test_rsa);

  return g_test_run();
}
Esempio n. 21
0
} END_TEST


/*@}*/

int main(int argc, char **argv) {
#ifdef HAVE_GTHREAD	
	//g_thread_init(NULL);
#endif

	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");

	g_test_add_func("/core/lua-load-factory", test_luaL_loadfile_factory);

	return g_test_run();
}
Esempio n. 22
0
int main(int argc, char **argv)
{
    bool has_ipv4, has_ipv6;

    module_call_init(MODULE_INIT_QOM);

    g_test_init(&argc, &argv, NULL);

    /* We're creating actual IPv4/6 sockets, so we should
     * check if the host running tests actually supports
     * each protocol to avoid breaking tests on machines
     * with either IPv4 or IPv6 disabled.
     */
    if (check_protocol_support(&has_ipv4, &has_ipv6) < 0) {
        return 1;
    }

    if (has_ipv4) {
        g_test_add_func("/io/channel/socket/ipv4-sync",
                        test_io_channel_ipv4_sync);
        g_test_add_func("/io/channel/socket/ipv4-async",
                        test_io_channel_ipv4_async);
        g_test_add_func("/io/channel/socket/ipv4-fd",
                        test_io_channel_ipv4_fd);
    }
    if (has_ipv6) {
        g_test_add_func("/io/channel/socket/ipv6-sync",
                        test_io_channel_ipv6_sync);
        g_test_add_func("/io/channel/socket/ipv6-async",
                        test_io_channel_ipv6_async);
    }

#ifndef _WIN32
    g_test_add_func("/io/channel/socket/unix-sync",
                    test_io_channel_unix_sync);
    g_test_add_func("/io/channel/socket/unix-async",
                    test_io_channel_unix_async);
    g_test_add_func("/io/channel/socket/unix-fd-pass",
                    test_io_channel_unix_fd_pass);
#endif /* _WIN32 */

    return g_test_run();
}
Esempio n. 23
0
int main(int argc, char *argv[]) {
  g_test_init(&argc, &argv, NULL);

  g_test_add_func("/regex/straight_match", test_straight_match);
  g_test_add_func("/regex/dot_match", test_dot_match);
  g_test_add_func("/regex/end_of_line", test_end_of_line);
  g_test_add_func("/regex/start_of_line", test_start_of_line);
  g_test_add_func("/regex/star", test_star);
  g_test_add_func("/regex/plus", test_plus);

  return g_test_run();
}
Esempio n. 24
0
void add_tests_parser() {
	g_test_add_func("/parser/bad_tile_class", test_parser_bad_tile_class);
	add_test_track_cache("/parser/parse_n_s_track", test_parser_parse_n_s_track);
	add_test_track_cache("/parser/e_w_track", test_parser_e_w_track);
	g_test_add_func("/parser/parse_n_s_e_w_track", test_parser_parse_n_s_e_w_track);
	add_test_track_cache("/parser/two_way_points", test_parser_two_way_points);
	add_test_track_cache("/parser/three_way_points", test_parser_three_way_points);
	add_test_track_cache("/parser/red_main_auto_signal", test_parser_red_main_auto_signal);
	add_test_track_cache("/parser/green_main_manual_signal", test_parser_green_main_manual_signal);
	add_test_track_cache("/parser/amber_sub_signal", test_parser_amber_sub_signal);
	g_test_add_func("/parser/print_ne_sw_track", test_parser_print_ne_sw_track);
	g_test_add_func("/parser/print_n_s_e_w_track", test_parser_print_n_s_e_w_track);
	g_test_add_func("/parser/print_two_way_points", test_parser_print_two_way_points);
	g_test_add_func("/parser/print_three_way_points", test_parser_print_three_way_points);
	g_test_add_func("/parser/print_red_main_auto_signal", test_parser_print_red_main_auto_signal);
}
int main(int argc, char *argv[])
{
	g_test_init(&argc, &argv, NULL);

	g_test_add_func("/gobex/test_pkt", test_pkt);
	g_test_add_func("/gobex/test_decode_pkt", test_decode_pkt);
	g_test_add_func("/gobex/test_decode_pkt_header",
						test_decode_pkt_header);
	g_test_add_func("/gobex/test_decode_connect",
						test_decode_connect);

	g_test_add_func("/gobex/test_decode_nval", test_decode_nval);

	g_test_add_func("/gobex/test_encode_pkt", test_decode_encode);

	g_test_add_func("/gobex/test_encode_on_demand", test_encode_on_demand);
	g_test_add_func("/gobex/test_encode_on_demand_fail",
						test_encode_on_demand_fail);

	g_test_add_func("/gobex/test_create_args", test_create_args);

	return g_test_run();
}
Esempio n. 26
0
int main(int argc, char *argv[])
{
	g_test_init(&argc, &argv, NULL);

	g_test_add_func("/ippool/Test case 1", test_case_1);
	g_test_add_func("/ippool/Test case 2", test_case_2);
	g_test_add_func("/ippool/Test case 3", test_case_3);
	g_test_add_func("/ippool/Test case 4", test_case_4);
	g_test_add_func("/ippool/Test case 5", test_case_5);
	g_test_add_func("/ippool/Test case 6", test_case_6);

	return g_test_run();
}
Esempio n. 27
0
File: gpoll.c Progetto: cosimoc/glib
int
main (int   argc,
      char *argv[])
{
  int result;
  GMainContext *ctx;

  g_test_init (&argc, &argv, NULL);
  init_networking ();
  ctx = g_main_context_new ();

  g_test_add_func ("/gpoll/gpoll", test_gpoll);

  result = g_test_run ();

  g_main_context_unref (ctx);

  return result;
}
Esempio n. 28
0
int
main (int   argc,
      char *argv[])
{
  gtk_test_init (&argc, &argv);
  gtk_test_register_all_types();
  g_test_add_func ("/ui-tests/text-access", test_text_access);
  g_test_add_func ("/ui-tests/button-clicks", test_button_clicks);
  g_test_add_func ("/ui-tests/keys-events", test_button_keys);
  g_test_add_func ("/ui-tests/slider-ranges", test_slider_ranges);
  g_test_add_func ("/ui-tests/xserver-sync", test_xserver_sync);
  g_test_add_func ("/ui-tests/spin-button-arrows", test_spin_button_arrows);
  return g_test_run();
}
Esempio n. 29
0
int main(int argc, char **argv) {
	//g_thread_init(NULL);
	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");

	g_test_add_func("/core/network_injection_new", t_network_injection_new);
	g_test_add_func("/core/network_injection_new_null", t_network_injection_new_null);
	g_test_add_func("/core/network_injection_queue_new", t_network_injection_queue_new);
	g_test_add_func("/core/network_injection_queue_append", t_network_injection_queue_append);
	g_test_add_func("/core/network_injection_queue_prepend", t_network_injection_queue_prepend);
	g_test_add_func("/core/network_injection_queue_reset", t_network_injection_queue_reset);

	return g_test_run();
}
Esempio n. 30
0
int
main (int argc,
        char **argv)
{
    g_test_init (&argc, &argv, NULL);

    g_test_add_func("/test/getservbyname", test_getservbyname);
/*
    g_test_add_func("/test/gethostbyname_not_docker",
            test_gethostbyname_not_docker);
    g_test_add_func("/test/gethostbyname_by_image_name",
            test_gethostbyname_by_image_name);
    g_test_add_func("/test/gethostbyname_unknown_name",
            test_gethostbyname_unknown_name);
    g_test_add_func("/test/gethostbyname2", test_gethostbyname2);
    g_test_add_func("/test/gethostbyname2_inet6", test_gethostbyname2_inet6);
    // g_test_add_func("/test/gethostbyaddr", test_gethostbyaddr);
*/
    return g_test_run ();
}