gplate/tags/tests/gplate-tag-test.h
author Gary Kramlich <grim@reaperworld.com>
Sun Jul 04 02:02:59 2010 -0500 (22 months ago)
changeset 395 2a257237a0ef
parent 394 ad26d98e20e6
permissions -rw-r--r--
removed gplate_tag_test_output
renamed gplate_tag_test_output_full to gplate_tag_test_output
updated as necessary
grim@394
     1
/*
grim@394
     2
 * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
grim@394
     3
 *
grim@394
     4
 * This program is free software: you can redistribute it and/or modify
grim@394
     5
 * it under the terms of the GNU General Public License as published by
grim@394
     6
 * the Free Software Foundation, either version 3 of the License, or
grim@394
     7
 * (at your option) any later version.
grim@394
     8
 *
grim@394
     9
 * This program is distributed in the hope that it will be useful,
grim@394
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
grim@394
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
grim@394
    12
 * GNU General Public License for more details.
grim@394
    13
 *
grim@394
    14
 * You should have received a copy of the GNU General Public License
grim@394
    15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
grim@394
    16
 */
grim@389
    17
#ifndef GPLATE_TAG_TEST_H
grim@389
    18
#define GPLATE_TAG_TEST_H
grim@389
    19
grim@389
    20
#include <gplate/gplate.h>
grim@389
    21
grim@389
    22
#include <glib.h>
grim@389
    23
grim@389
    24
#define gplate_tag_test_add(path, func) \
grim@389
    25
	g_test_add((path), GPlateTagTestFixture, NULL, gplate_tag_test_setup, (func), gplate_tag_test_teardown)
grim@389
    26
grim@389
    27
typedef struct _GPlateTagTestFixture GPlateTagTestFixture;
grim@389
    28
grim@389
    29
typedef void (*GPlateTagTestFixtureFunc)(GPlateTagTestFixture *fixture, gconstpointer data);
grim@389
    30
grim@389
    31
struct _GPlateTagTestFixture {
grim@389
    32
	GPlateTemplate *template;
grim@389
    33
	GError *error;
grim@389
    34
grim@389
    35
	const gchar *template_string;
grim@389
    36
grim@389
    37
	const gchar *expected;
grim@389
    38
	gchar *actual;
grim@389
    39
};
grim@389
    40
grim@389
    41
G_BEGIN_DECLS
grim@389
    42
grim@389
    43
void gplate_tag_test_setup(GPlateTagTestFixture *fixture, gconstpointer data);
grim@389
    44
void gplate_tag_test_teardown(GPlateTagTestFixture *fixture, gconstpointer data);
grim@395
    45
void gplate_tag_test_output(GPlateTagTestFixture *fixture, gconstpointer data, const gchar *template_string, const gchar *expected);
grim@389
    46
grim@389
    47
G_END_DECLS
grim@389
    48
grim@389
    49
#endif /* GPLATE_TAG_TEST_H */