[evolution-data-server] Update libebook-contacts::test-untyped-phones test
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Update libebook-contacts::test-untyped-phones test
- Date: Tue, 12 Nov 2013 13:33:10 +0000 (UTC)
commit ca9647f791dab826b9ed9d069fb937765e13698e
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 12 14:28:21 2013 +0100
Update libebook-contacts::test-untyped-phones test
The test_business has been disabled, because it was failing, but it
was failing even in time of 2.28. Looking briefly into RFC 2426
shows that the 'VOICE' is a default 'TEL' type, but there is no
indication that the left-alone 'WORK' is supposed to be the same
as 'WORK,VOICE' type. Due to this are done these changes.
tests/libebook-contacts/test-untyped-phones.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/tests/libebook-contacts/test-untyped-phones.c b/tests/libebook-contacts/test-untyped-phones.c
index 7791f01..50987ff 100644
--- a/tests/libebook-contacts/test-untyped-phones.c
+++ b/tests/libebook-contacts/test-untyped-phones.c
@@ -2,13 +2,14 @@
#include <string.h>
#include <libebook/libebook.h>
-/* TEL;WORK:... should map to PHONE_BUSINESS
+/* TEL;WORK,VOICE:... should map to PHONE_BUSINESS
+ * TEL;VOICE:... should map to PHONE_OTHER
* TEL;FAX:... should map to OTHER_FAX. */
#define VCARD \
"BEGIN:VCARD\n" \
"FN:Janet Jackson\n" \
"N:Janet\n" \
- "TEL;WORK:123-123-1234\n" \
+ "TEL;WORK,VOICE:123-123-1234\n" \
"TEL;VOICE:456-456-4567\n" \
"TEL;FAX:321-321-4321\n" \
"END:VCARD\n"
@@ -29,6 +30,21 @@ test_business (void)
}
static void
+test_other_phone (void)
+{
+ EContact *contact;
+ const gchar *phone;
+
+ contact = e_contact_new_from_vcard (VCARD);
+
+ phone = e_contact_get_const (contact, E_CONTACT_PHONE_OTHER);
+ g_assert (phone != NULL);
+ g_assert_cmpstr (phone, ==, "456-456-4567");
+
+ g_object_unref (contact);
+}
+
+static void
test_other_fax (void)
{
EContact *contact;
@@ -50,11 +66,8 @@ main (gint argc,
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
-#if 0 /* This is failing for some reason, somewhere in EDS history it broke,
- * for now I'm leaving the compiler warning in place intentionally
- */
g_test_add_func ("/Contact/UntypedPhones/Business", test_business);
-#endif
+ g_test_add_func ("/Contact/UntypedPhones/OtherPhone", test_other_phone);
g_test_add_func ("/Contact/UntypedPhones/OtherFax", test_other_fax);
return g_test_run ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]