aboutsummaryrefslogtreecommitdiff
path: root/tests/test_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_template.c')
-rw-r--r--tests/test_template.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/test_template.c b/tests/test_template.c
index fda860a..05d8242 100644
--- a/tests/test_template.c
+++ b/tests/test_template.c
@@ -39,9 +39,9 @@ void test_tpl_workflow() {
tpl_reset();
tpl_register("hello_message", &data);
- OMC_ASSERT(strcmp(tpl_render("I said, \"{{ hello_message }}\""), "I said, \"Hello world!\"") == 0, "stored value in key is incorrect");
+ STASIS_ASSERT(strcmp(tpl_render("I said, \"{{ hello_message }}\""), "I said, \"Hello world!\"") == 0, "stored value in key is incorrect");
setenv("HELLO", "Hello environment!", 1);
- OMC_ASSERT(strcmp(tpl_render("{{ env:HELLO }}"), "Hello environment!") == 0, "environment variable content mismatch");
+ STASIS_ASSERT(strcmp(tpl_render("{{ env:HELLO }}"), "Hello environment!") == 0, "environment variable content mismatch");
unsetenv("HELLO");
guard_free(data);
}
@@ -52,8 +52,8 @@ void test_tpl_register() {
unsigned used_before_register = tpl_pool_used;
tpl_register("hello_message", &data);
- OMC_ASSERT(tpl_pool_used == (used_before_register + 1), "tpl_register did not increment allocation counter");
- OMC_ASSERT(tpl_pool[used_before_register] != NULL, "register did not allocate a tpl_item record in the pool");
+ STASIS_ASSERT(tpl_pool_used == (used_before_register + 1), "tpl_register did not increment allocation counter");
+ STASIS_ASSERT(tpl_pool[used_before_register] != NULL, "register did not allocate a tpl_item record in the pool");
free(data);
}
@@ -69,32 +69,32 @@ void test_tpl_register_func() {
tpl_register_func("sub", &tasks[1]);
tpl_register_func("mul", &tasks[2]);
tpl_register_func("div", &tasks[3]);
- OMC_ASSERT(tpl_pool_func_used == sizeof(tasks) / sizeof(*tasks), "unexpected function pool used");
+ STASIS_ASSERT(tpl_pool_func_used == sizeof(tasks) / sizeof(*tasks), "unexpected function pool used");
char *result = NULL;
result = tpl_render("{{ func:add(0,3) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:add(1,2) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:sub(6,3) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:sub(4,1) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:mul(1, 3) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:div(6,2) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
result = tpl_render("{{ func:div(3,1) }}");
- OMC_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
+ STASIS_ASSERT(result != NULL && strcmp(result, "3") == 0, "Answer was not 3");
}
int main(int argc, char *argv[]) {
- OMC_TEST_BEGIN_MAIN();
- OMC_TEST_FUNC *tests[] = {
+ STASIS_TEST_BEGIN_MAIN();
+ STASIS_TEST_FUNC *tests[] = {
test_tpl_workflow,
test_tpl_register_func,
test_tpl_register,
};
- OMC_TEST_RUN(tests);
- OMC_TEST_END_MAIN();
+ STASIS_TEST_RUN(tests);
+ STASIS_TEST_END_MAIN();
} \ No newline at end of file