1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gplate/tags/tests/test-gplate-tag.h Sun Jul 04 03:34:39 2010 -0500
1.3 @@ -0,0 +1,50 @@
1.4 +/*
1.5 + * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
1.6 + *
1.7 + * This program is free software: you can redistribute it and/or modify
1.8 + * it under the terms of the GNU General Public License as published by
1.9 + * the Free Software Foundation, either version 3 of the License, or
1.10 + * (at your option) any later version.
1.11 + *
1.12 + * This program is distributed in the hope that it will be useful,
1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.15 + * GNU General Public License for more details.
1.16 + *
1.17 + * You should have received a copy of the GNU General Public License
1.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
1.19 + */
1.20 +#ifndef TEST_GPLATE_TAG_H
1.21 +#define TEST_GPLATE_TAG_H
1.22 +
1.23 +#include <gplate/gplate.h>
1.24 +
1.25 +#include <glib.h>
1.26 +
1.27 +#define test_gplate_tag_add(path, func) \
1.28 + g_test_add((path), TestGPlateTagFixture, NULL, test_gplate_tag_setup, (func), test_gplate_tag_teardown)
1.29 +
1.30 +typedef struct _TestGPlateTagFixture TestGPlateTagFixture;
1.31 +
1.32 +typedef void (*TestGPlateTagFixtureFunc)(TestGPlateTagFixture *fixture, gconstpointer data);
1.33 +
1.34 +struct _TestGPlateTagFixture {
1.35 + GPlateTemplate *template;
1.36 + GError *error;
1.37 +
1.38 + const gchar *template_string;
1.39 +
1.40 + const gchar *expected;
1.41 + gchar *actual;
1.42 +};
1.43 +
1.44 +G_BEGIN_DECLS
1.45 +
1.46 +void test_gplate_tag_setup(TestGPlateTagFixture *fixture, gconstpointer data);
1.47 +void test_gplate_tag_teardown(TestGPlateTagFixture *fixture, gconstpointer data);
1.48 +void test_gplate_tag_output(TestGPlateTagFixture *fixture, gconstpointer data, const gchar *template_string, const gchar *expected);
1.49 +
1.50 +G_END_DECLS
1.51 +
1.52 +#endif /* TEST_GPLATE_TAG_H */
1.53 +