grim/gplate
Clone
Summary
Browse
Changes
Graph
rewording so vim syntax highlighting doesn't blow up
2009-06-21, Gary Kramlich
4e8d21e4d53d
rewording so vim syntax highlighting doesn't blow up
#include
<glib.h>
#include
<check.h>
#include
<stdlib.h>
#include
<gplate/gplate.h>
#include
"test.h"
/******************************************************************************
* Helpers
*****************************************************************************/
Suite
*
master_suite
(
void
)
{
Suite
*
s
=
suite_create
(
"Master Suite"
);
return
s
;
}
/******************************************************************************
* API
*****************************************************************************/
void
test_string
(
const
gchar
*
expected
,
const
gchar
*
actual
)
{
fail_if
(
expected
&&
!
actual
,
TEST_EXPECTED_ACTUAL_MSG
,
expected
,
actual
);
fail_if
(
!
expected
&&
actual
,
TEST_EXPECTED_ACTUAL_MSG
,
expected
,
actual
);
/* we need to handle a NULL value differently */
if
(
!
expected
)
{
fail_unless
(
!
expected
,
TEST_EXPECTED_ACTUAL_MSG
,
expected
,
actual
);
}
else
{
fail_unless
(
g_utf8_collate
(
expected
,
actual
)
==
0
,
TEST_EXPECTED_ACTUAL_MSG
,
expected
,
actual
);
}
}
/******************************************************************************
* Main!!
*****************************************************************************/
gint
main
(
void
)
{
gint
nfail
=
0
;
SRunner
*
sr
=
NULL
;
g_type_init
();
gplate_config_load_default
();
sr
=
srunner_create
(
master_suite
());
srunner_set_xml
(
sr
,
"gplate-tests.xml"
);
srunner_add_suite
(
sr
,
variable_suite
());
srunner_add_suite
(
sr
,
dictionary_variable_suite
());
srunner_add_suite
(
sr
,
file_variable_suite
());
srunner_add_suite
(
sr
,
syntax_suite
());
srunner_add_suite
(
sr
,
for_suite
());
srunner_add_suite
(
sr
,
include_suite
());
srunner_add_suite
(
sr
,
test_util_suite
());
srunner_run_all
(
sr
,
CK_NORMAL
);
nfail
=
srunner_ntests_failed
(
sr
);
srunner_free
(
sr
);
return
(
nfail
==
0
)
?
EXIT_SUCCESS
:
EXIT_FAILURE
;
}