static void run_test_start_uhc(const struct test_case *test) { // Start USB host stack uhc_start(); record_events(); CHECK_EVENT_HOST_MODE(); CHECK_EVENT_VBUS_PRESENT(); }
static void test_ui_file (GFile *file) { gchar *ui_file, *in_file, *out_file; GString *record; GError *error = NULL; ui_file = g_file_get_path (file); in_file = get_test_file (ui_file, ".in", TRUE); out_file = get_test_file (ui_file, ".out", TRUE); record = g_string_new (""); record_events (ui_file, in_file, record); if (out_file) { char *diff = diff_with_file (out_file, record->str, record->len, &error); g_assert_no_error (error); if (diff && diff[0]) { g_printerr ("Contents don't match expected contents:\n%s", diff); g_test_fail (); g_free (diff); } } else if (record->str[0]) { g_test_message ("Expected a reference file:\n%s", record->str); g_test_fail (); } g_string_free (record, TRUE); g_free (in_file); g_free (out_file); g_free (ui_file); }