Commit f8fa84b0 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

libs/gst/check/gstcheck.h: add some assert_ as alias for fail_unless_*

Original commit message from CVS:
* libs/gst/check/gstcheck.h:
add some assert_ as alias for fail_unless_*
* tests/check/gst/gst.c: (GST_START_TEST), (gst_suite):
increase test coverage
parent 2c976b1d
2006-07-03 Thomas Vander Stichele <thomas at apestaart dot org>
* libs/gst/check/gstcheck.h:
add some assert_ as alias for fail_unless_*
* tests/check/gst/gst.c: (GST_START_TEST), (gst_suite):
increase test coverage
2006-07-02 Thomas Vander Stichele <thomas at apestaart dot org>
* Makefile.am:
......
......@@ -78,6 +78,7 @@ gint gst_check_run_suite (Suite *suite, const gchar *name, const gchar *fname);
#define fail_unless_message_error(msg, domain, code) \
gst_check_message_error (msg, GST_MESSAGE_ERROR, \
GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code)
#define assert_message_error(m, d, c) fail_unless_message_error(m, d, c)
/***
* wrappers for START_TEST and END_TEST
......@@ -98,6 +99,7 @@ G_STMT_START { \
fail_unless(first == second, \
"'" #a "' (%d) is not equal to '" #b"' (%d)", first, second); \
} G_STMT_END;
#define assert_equals_int(a, b) fail_unless_equals_int(a, b)
#define fail_unless_equals_uint64(a, b) \
G_STMT_START { \
......@@ -107,6 +109,7 @@ G_STMT_START { \
"'" #a "' (%" G_GUINT64_FORMAT ") is not equal to '" #b"' (%" \
G_GUINT64_FORMAT ")", first, second); \
} G_STMT_END;
#define assert_equals_uint64(a, b) fail_unless_equals_uint64(a, b)
#define fail_unless_equals_string(a, b) \
G_STMT_START { \
......@@ -115,6 +118,7 @@ G_STMT_START { \
fail_unless(strcmp (first, second) == 0, \
"'" #a "' (%s) is not equal to '" #b"' (%s)", first, second); \
} G_STMT_END;
#define assert_equals_string(a, b) fail_unless_equals_string(a, b)
/***
......
......@@ -20,6 +20,7 @@
*/
#include <gst/check/gstcheck.h>
#include <gst/gstversion.h>
GST_START_TEST (test_init)
{
......@@ -76,6 +77,20 @@ GST_START_TEST (test_new_fakesrc)
GST_END_TEST;
GST_START_TEST (test_version)
{
guint major, minor, micro, nano;
gchar *version;
gst_version (&major, &minor, &micro, &nano);
assert_equals_int (major, GST_VERSION_MAJOR);
version = gst_version_string ();
fail_if (version == NULL);
g_free (version);
}
GST_END_TEST;
Suite *
gst_suite (void)
......@@ -89,6 +104,7 @@ gst_suite (void)
tcase_add_test (tc_chain, test_deinit_sysclock);
tcase_add_test (tc_chain, test_new_pipeline);
tcase_add_test (tc_chain, test_new_fakesrc);
tcase_add_test (tc_chain, test_version);
return s;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment