gplate/tags/tests/gplate-tag-test.h
author Gary Kramlich <grim@reaperworld.com>
Fri Jul 02 02:56:50 2010 -0500 (22 months ago)
changeset 389 8baf0603ff07
child 394 ad26d98e20e6
permissions -rw-r--r--
Create a sublibrary for the tag testing. I'll probably do this for all components going forward.

Pretty much just reimplemented the tests that were created for check with gtester and ctest
     1 #ifndef GPLATE_TAG_TEST_H
     2 #define GPLATE_TAG_TEST_H
     3 
     4 #include <gplate/gplate.h>
     5 
     6 #include <glib.h>
     7 
     8 #define gplate_tag_test_add(path, func) \
     9 	g_test_add((path), GPlateTagTestFixture, NULL, gplate_tag_test_setup, (func), gplate_tag_test_teardown)
    10 
    11 typedef struct _GPlateTagTestFixture GPlateTagTestFixture;
    12 
    13 typedef void (*GPlateTagTestFixtureFunc)(GPlateTagTestFixture *fixture, gconstpointer data);
    14 
    15 struct _GPlateTagTestFixture {
    16 	GPlateTemplate *template;
    17 	GError *error;
    18 
    19 	const gchar *template_string;
    20 
    21 	const gchar *expected;
    22 	gchar *actual;
    23 };
    24 
    25 G_BEGIN_DECLS
    26 
    27 void gplate_tag_test_setup(GPlateTagTestFixture *fixture, gconstpointer data);
    28 void gplate_tag_test_teardown(GPlateTagTestFixture *fixture, gconstpointer data);
    29 void gplate_tag_test_output(GPlateTagTestFixture *fixture, gconstpointer data);
    30 
    31 G_END_DECLS
    32 
    33 #endif /* GPLATE_TAG_TEST_H */