gplate/functions/tests/test-gplate-for-function.c
changeset 406 9b903d04907a
parent 402 b9a2a060c766
     1.1 --- a/gplate/functions/tests/test-gplate-for-function.c	Sun Jul 04 03:40:27 2010 -0500
     1.2 +++ b/gplate/functions/tests/test-gplate-for-function.c	Sun Jul 04 16:49:50 2010 -0500
     1.3 @@ -25,7 +25,7 @@
     1.4  typedef struct {
     1.5  	const gchar *name;
     1.6  	const gchar *value;
     1.7 -} GPlateForFunctionTestData;
     1.8 +} TestGPlateForFunctionData;
     1.9  
    1.10  typedef struct {
    1.11  	GPlateTemplate *template;
    1.12 @@ -39,14 +39,14 @@
    1.13  
    1.14  	GError *error;
    1.15  
    1.16 -	GPlateForFunctionTestData *data;
    1.17 -} GPlateForFunctionTestFixture;
    1.18 +	TestGPlateForFunctionData *data;
    1.19 +} TestGPlateForFunctionFixture;
    1.20  
    1.21  /******************************************************************************
    1.22   * Fixtures
    1.23   *****************************************************************************/
    1.24  static void
    1.25 -gplate_for_function_test_setup(GPlateForFunctionTestFixture *fixture,
    1.26 +test_gplate_for_function_setup(TestGPlateForFunctionFixture *fixture,
    1.27                                 gconstpointer d)
    1.28  {
    1.29  	fixture->template = gplate_template_new();
    1.30 @@ -57,7 +57,7 @@
    1.31  }
    1.32  
    1.33  static void
    1.34 -gplate_for_function_test_teardown(GPlateForFunctionTestFixture *fixture,
    1.35 +test_gplate_for_function_teardown(TestGPlateForFunctionFixture *fixture,
    1.36                                    gconstpointer d)
    1.37  {
    1.38  	g_object_unref(fixture->template);
    1.39 @@ -81,7 +81,7 @@
    1.40   * Helpers
    1.41   *****************************************************************************/
    1.42  static void
    1.43 -gplate_for_function_test(GPlateForFunctionTestFixture *fixture) {
    1.44 +test_gplate_for_function(TestGPlateForFunctionFixture *fixture) {
    1.45  	gint i = 0;
    1.46  
    1.47  	/* add the variables */
    1.48 @@ -104,10 +104,10 @@
    1.49   * Simple For's
    1.50   *****************************************************************************/
    1.51  static void
    1.52 -gplate_for_function_test_zero_elements(GPlateForFunctionTestFixture *fixture,
    1.53 +test_gplate_for_function_zero_elements(TestGPlateForFunctionFixture *fixture,
    1.54                                         gconstpointer user_data)
    1.55  {
    1.56 -	GPlateForFunctionTestData data[] = {
    1.57 +	TestGPlateForFunctionData data[] = {
    1.58  		{ NULL, NULL },
    1.59  	};
    1.60  
    1.61 @@ -115,14 +115,14 @@
    1.62  	fixture->template_string = "{% for in in line %}{{ i }}{% endfor %}";
    1.63  	fixture->expected = "";
    1.64  
    1.65 -	gplate_for_function_test(fixture);
    1.66 +	test_gplate_for_function(fixture);
    1.67  }
    1.68  
    1.69  static void
    1.70 -gplate_for_function_test_one_element(GPlateForFunctionTestFixture *fixture,
    1.71 +test_gplate_for_function_one_element(TestGPlateForFunctionFixture *fixture,
    1.72                                       gconstpointer user_data)
    1.73  {
    1.74 -	GPlateForFunctionTestData data[] = {
    1.75 +	TestGPlateForFunctionData data[] = {
    1.76  		{ "one", "1" },
    1.77  		{ NULL, NULL },
    1.78  	};
    1.79 @@ -131,14 +131,14 @@
    1.80  	fixture->template_string = "{% for i in list %}{{ i }}{% endfor %}";
    1.81  	fixture->expected = "1";
    1.82  
    1.83 -	gplate_for_function_test(fixture);
    1.84 +	test_gplate_for_function(fixture);
    1.85  }
    1.86  
    1.87  static void
    1.88 -gplate_for_function_test_two_elements(GPlateForFunctionTestFixture *fixture,
    1.89 +test_gplate_for_function_two_elements(TestGPlateForFunctionFixture *fixture,
    1.90                                        gconstpointer user_data)
    1.91  {
    1.92 -	GPlateForFunctionTestData data[] = {
    1.93 +	TestGPlateForFunctionData data[] = {
    1.94  		{ "a", "A" },
    1.95  		{ "b", "B" },
    1.96  		{ NULL, NULL },
    1.97 @@ -148,7 +148,7 @@
    1.98  	fixture->template_string = "{% for i in list %}{{ i }}{% endfor %}";
    1.99  	fixture->expected = "AB";
   1.100  
   1.101 -	gplate_for_function_test(fixture);
   1.102 +	test_gplate_for_function(fixture);
   1.103  }
   1.104  
   1.105  /******************************************************************************
   1.106 @@ -163,25 +163,25 @@
   1.107  	gplate_config_load_default();
   1.108  
   1.109  	g_test_add("/functions/foo/zero_elements",
   1.110 -	           GPlateForFunctionTestFixture,
   1.111 +	           TestGPlateForFunctionFixture,
   1.112  	           NULL,
   1.113 -	           gplate_for_function_test_setup,
   1.114 -	           gplate_for_function_test_zero_elements,
   1.115 -	           gplate_for_function_test_teardown);
   1.116 +	           test_gplate_for_function_setup,
   1.117 +	           test_gplate_for_function_zero_elements,
   1.118 +	           test_gplate_for_function_teardown);
   1.119  
   1.120  	g_test_add("/functions/foo/one_element",
   1.121 -	           GPlateForFunctionTestFixture,
   1.122 +	           TestGPlateForFunctionFixture,
   1.123  	           NULL,
   1.124 -	           gplate_for_function_test_setup,
   1.125 -	           gplate_for_function_test_one_element,
   1.126 -	           gplate_for_function_test_teardown);
   1.127 +	           test_gplate_for_function_setup,
   1.128 +	           test_gplate_for_function_one_element,
   1.129 +	           test_gplate_for_function_teardown);
   1.130  
   1.131  	g_test_add("/functions/foo/two_elements",
   1.132 -	           GPlateForFunctionTestFixture,
   1.133 +	           TestGPlateForFunctionFixture,
   1.134  	           NULL,
   1.135 -	           gplate_for_function_test_setup,
   1.136 -	           gplate_for_function_test_two_elements,
   1.137 -	           gplate_for_function_test_teardown);
   1.138 +	           test_gplate_for_function_setup,
   1.139 +	           test_gplate_for_function_two_elements,
   1.140 +	           test_gplate_for_function_teardown);
   1.141  
   1.142  	return g_test_run();
   1.143  }