示例#1
0
static void
stub_equal_list (void)
{
    list1 = g_list_append(list1, GINT_TO_POINTER(100));
    list1 = g_list_append(list1, GINT_TO_POINTER(-200));
    list2 = g_list_append(list2, GINT_TO_POINTER(-1000));
    list2 = g_list_append(list2, GINT_TO_POINTER(2000));

    gcut_assert_equal_list(list1, list1,
                           stub_equal_list_equal_func,
                           stub_equal_list_inspect_func, "AAA");
    gcut_assert_equal_list(list2, list2,
                           stub_equal_list_equal_func,
                           stub_equal_list_inspect_func, "BBB");

    MARK_FAIL(gcut_assert_equal_list(list1, list2,
                                     stub_equal_list_equal_func,
                                     stub_equal_list_inspect_func, "CCC"));
}
void
milter_assert_equal_headers_helper (MilterHeaders *expected,
                                    MilterHeaders *actual,
                                    const gchar *expression_expected,
                                    const gchar *expression_actual)
{
    gcut_assert_equal_list((GList *)headers_to_list(expected),
                           (GList *)headers_to_list(actual),
                           (GEqualFunc)gcut_list_equal_string,
                           header_list_inspect,
                           NULL);
}
示例#3
0
void
test_attachment (void)
{
  GList *expected = NULL, *actual;

  document = load_document ("attachment.pdf");
  cut_assert_true (poppler_document_has_attachments (document));

  expected = g_list_append (expected,
                            attachment_new ("hello.html", "hello.html", 300,
                                            0, 0, NULL));
  expected = g_list_append (expected,
                            attachment_new ("hello.txt", "hello.txt", 13,
                                            0, 0, NULL));

  actual = poppler_document_get_attachments (document);
  gcut_take_list (expected, attachment_unref);
  gcut_take_list (actual, attachment_unref);
  gcut_assert_equal_list (expected,
                          actual,
                          attachment_equal,
                          attachment_inspect,
                          NULL);
}