diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-05-04 11:42:06 +1000 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-05-04 11:42:06 +1000 |
commit | d3a4812224e51436aafc0ba9be01763a8fe68615 (patch) | |
tree | bf953fc3e0219d3fbb12d452e714c8aa2b7cac16 /tests/enums.c | |
parent | 19d2e7a4277c109ee6dbd69ee1e51a4d24f679f1 (diff) | |
download | telepathy-glib-d3a4812224e51436aafc0ba9be01763a8fe68615.tar.gz |
Add a regression test to check the values for NUM_TP_{CONTACT_FEATURES,DBUS_ERRORS} are up to date.
Diffstat (limited to 'tests/enums.c')
-rw-r--r-- | tests/enums.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/enums.c b/tests/enums.c new file mode 100644 index 000000000..1b2f2c78c --- /dev/null +++ b/tests/enums.c @@ -0,0 +1,60 @@ +/* Test enum #defines are up to date + * + * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> + * + * Copying and distribution of this file, with or without modification, + * are permitted in any medium without royalty provided the copyright + * notice and this notice are preserved. + */ + +#include <telepathy-glib/enums.h> + +#include <telepathy-glib/contact.h> +#include <telepathy-glib/proxy.h> + +#include "tests/lib/debug.h" +#include "tests/lib/util.h" + +static void +test_tp_contact_feature (void) +{ + GEnumClass *klass; + + g_type_init (); + + klass = g_type_class_ref (TP_TYPE_CONTACT_FEATURE); + + g_assert (klass != NULL); + g_assert (G_IS_ENUM_CLASS (klass)); + + g_assert_cmpint (klass->n_values, ==, NUM_TP_CONTACT_FEATURES); +} + + +static void +test_tp_dbus_error (void) +{ + GEnumClass *klass; + + g_type_init (); + + klass = g_type_class_ref (TP_TYPE_DBUS_ERROR); + + g_assert (klass != NULL); + g_assert (G_IS_ENUM_CLASS (klass)); + + g_assert_cmpint (klass->n_values, ==, NUM_TP_DBUS_ERRORS); +} + + +int +main (int argc, + char **argv) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/enums/tp-contact-feature", test_tp_contact_feature); + g_test_add_func ("/enums/tp-dbus-error", test_tp_dbus_error); + + return g_test_run (); +} |