grim/gplate

9b903d04907a
Parents b90b9411363f
Children 3cecf46b0dd6
fixed the name space issues for the for function test
--- a/gplate/functions/tests/test-gplate-for-function.c Sun Jul 04 16:09:43 2010 -0500
+++ b/gplate/functions/tests/test-gplate-for-function.c Sun Jul 04 16:49:50 2010 -0500
@@ -25,7 +25,7 @@
typedef struct {
const gchar *name;
const gchar *value;
-} GPlateForFunctionTestData;
+} TestGPlateForFunctionData;
typedef struct {
GPlateTemplate *template;
@@ -39,14 +39,14 @@
GError *error;
- GPlateForFunctionTestData *data;
-} GPlateForFunctionTestFixture;
+ TestGPlateForFunctionData *data;
+} TestGPlateForFunctionFixture;
/******************************************************************************
* Fixtures
*****************************************************************************/
static void
-gplate_for_function_test_setup(GPlateForFunctionTestFixture *fixture,
+test_gplate_for_function_setup(TestGPlateForFunctionFixture *fixture,
gconstpointer d)
{
fixture->template = gplate_template_new();
@@ -57,7 +57,7 @@
}
static void
-gplate_for_function_test_teardown(GPlateForFunctionTestFixture *fixture,
+test_gplate_for_function_teardown(TestGPlateForFunctionFixture *fixture,
gconstpointer d)
{
g_object_unref(fixture->template);
@@ -81,7 +81,7 @@
* Helpers
*****************************************************************************/
static void
-gplate_for_function_test(GPlateForFunctionTestFixture *fixture) {
+test_gplate_for_function(TestGPlateForFunctionFixture *fixture) {
gint i = 0;
/* add the variables */
@@ -104,10 +104,10 @@
* Simple For's
*****************************************************************************/
static void
-gplate_for_function_test_zero_elements(GPlateForFunctionTestFixture *fixture,
+test_gplate_for_function_zero_elements(TestGPlateForFunctionFixture *fixture,
gconstpointer user_data)
{
- GPlateForFunctionTestData data[] = {
+ TestGPlateForFunctionData data[] = {
{ NULL, NULL },
};
@@ -115,14 +115,14 @@
fixture->template_string = "{% for in in line %}{{ i }}{% endfor %}";
fixture->expected = "";
- gplate_for_function_test(fixture);
+ test_gplate_for_function(fixture);
}
static void
-gplate_for_function_test_one_element(GPlateForFunctionTestFixture *fixture,
+test_gplate_for_function_one_element(TestGPlateForFunctionFixture *fixture,
gconstpointer user_data)
{
- GPlateForFunctionTestData data[] = {
+ TestGPlateForFunctionData data[] = {
{ "one", "1" },
{ NULL, NULL },
};
@@ -131,14 +131,14 @@
fixture->template_string = "{% for i in list %}{{ i }}{% endfor %}";
fixture->expected = "1";
- gplate_for_function_test(fixture);
+ test_gplate_for_function(fixture);
}
static void
-gplate_for_function_test_two_elements(GPlateForFunctionTestFixture *fixture,
+test_gplate_for_function_two_elements(TestGPlateForFunctionFixture *fixture,
gconstpointer user_data)
{
- GPlateForFunctionTestData data[] = {
+ TestGPlateForFunctionData data[] = {
{ "a", "A" },
{ "b", "B" },
{ NULL, NULL },
@@ -148,7 +148,7 @@
fixture->template_string = "{% for i in list %}{{ i }}{% endfor %}";
fixture->expected = "AB";
- gplate_for_function_test(fixture);
+ test_gplate_for_function(fixture);
}
/******************************************************************************
@@ -163,25 +163,25 @@
gplate_config_load_default();
g_test_add("/functions/foo/zero_elements",
- GPlateForFunctionTestFixture,
+ TestGPlateForFunctionFixture,
NULL,
- gplate_for_function_test_setup,
- gplate_for_function_test_zero_elements,
- gplate_for_function_test_teardown);
+ test_gplate_for_function_setup,
+ test_gplate_for_function_zero_elements,
+ test_gplate_for_function_teardown);
g_test_add("/functions/foo/one_element",
- GPlateForFunctionTestFixture,
+ TestGPlateForFunctionFixture,
NULL,
- gplate_for_function_test_setup,
- gplate_for_function_test_one_element,
- gplate_for_function_test_teardown);
+ test_gplate_for_function_setup,
+ test_gplate_for_function_one_element,
+ test_gplate_for_function_teardown);
g_test_add("/functions/foo/two_elements",
- GPlateForFunctionTestFixture,
+ TestGPlateForFunctionFixture,
NULL,
- gplate_for_function_test_setup,
- gplate_for_function_test_two_elements,
- gplate_for_function_test_teardown);
+ test_gplate_for_function_setup,
+ test_gplate_for_function_two_elements,
+ test_gplate_for_function_teardown);
return g_test_run();
}