コード例 #1
0
ファイル: event-setters.c プロジェクト: sardemff7/eventd
static void
_test_new_good_null(gpointer fixture, gconstpointer user_data)
{
    if ( ! g_test_undefined() )
            return;
    if ( g_test_subprocess() )
    {
        eventd_event_new_for_uuid_string(EVENTD_EVENT_TEST_UUID, NULL, NULL);
        exit(0);
    }
    g_test_trap_subprocess(NULL, 0, 0);
    g_test_trap_assert_failed();
}
コード例 #2
0
ファイル: event-setters.c プロジェクト: sardemff7/eventd
static void
_test_add_data_null_good_good(gpointer fixture, gconstpointer user_data)
{
    if ( ! g_test_undefined() )
            return;
    if ( g_test_subprocess() )
    {
        eventd_event_add_data_string(NULL, EVENTD_EVENT_TEST_DATA_NAME, EVENTD_EVENT_TEST_DATA_CONTENT);
        exit(0);
    }
    g_test_trap_subprocess(NULL, 0, 0);
    g_test_trap_assert_failed();
}
コード例 #3
0
ファイル: event-setters.c プロジェクト: sardemff7/eventd
static void
_test_add_data_notnull_good_bad(gpointer fixture, gconstpointer user_data)
{
    SettersData *data = fixture;

    if ( ! g_test_undefined() )
            return;
    if ( g_test_subprocess() )
    {
        eventd_event_add_data_string(data->event, EVENTD_EVENT_TEST_DATA_NAME, NULL);
        exit(0);
    }
    g_test_trap_subprocess(NULL, 0, 0);
    g_test_trap_assert_failed();
}
コード例 #4
0
ファイル: logging.c プロジェクト: antono/glib
/* Test g_warn macros */
static void
test_warnings (void)
{
  if (!g_test_undefined ())
    return;

  if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
    {
      g_warn_if_reached ();
    }
  g_test_trap_assert_failed();
  g_test_trap_assert_stderr ("*WARNING*test_warnings*should not be reached*");

  if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
    {
      g_warn_if_fail (FALSE);
    }
  g_test_trap_assert_failed();
  g_test_trap_assert_stderr ("*WARNING*test_warnings*runtime check failed*");
}