diff options
Diffstat (limited to 'src/geometry/geometry.test.c')
-rw-r--r-- | src/geometry/geometry.test.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/geometry/geometry.test.c b/src/geometry/geometry.test.c index fd1f379..298de3a 100644 --- a/src/geometry/geometry.test.c +++ b/src/geometry/geometry.test.c @@ -62,8 +62,7 @@ LILY_TEST("read normal float_array") CHECK_EQF(arr.buf[1], 0.0, "%f"); CHECK_EQF(arr.buf[2], 0.5, "%f"); - free(arr.id); - free(arr.buf); + kai_release_float_array(arr); } #include LILY_PUSH_TEST() @@ -113,6 +112,8 @@ LILY_TEST("read param tag") CHECK_EQ(param.sid, NULL, "%p"); CHECK_EQS(param.type, "float"); CHECK_EQ(param.semantic, NULL, "%p"); + + kai_release_param(param); } #include LILY_PUSH_TEST() @@ -172,8 +173,7 @@ LILY_TEST("parse accessor") CHECK_EQS(acc.param[1].name, "y"); CHECK_EQS(acc.param[2].name, "z"); - free(acc.source); - for (int i=0; i<3; i++) free(acc.param[i].name); + kai_release_accessor(acc); } #include LILY_PUSH_TEST() @@ -214,13 +214,27 @@ LILY_TEST("read source correctly") "<source id=\"source\">" " <float_array count=\"1\">0.0</float_array>" " <technique_common>" - " <accessor count=\"1\" id=\"xxx\">" + " <accessor count=\"1\" source=\"xxx\">" " <param type=\"float\" />" " </accessor>" " </technique_common>" "</source>" ); + + struct ka_source_t source; + int result = kai_read_source(&source, t); + kai_tag_destroy(t); + + CHECK_EQ(result, 0, "%d"); + REQUIRE_EQS(source.id, "source"); + CHECK_EQS(source.name, NULL); + + CHECK_EQ(source.float_array.count, 1, "%d"); + CHECK_EQS(source.accessor.source, "xxx"); + + kai_release_source(source); } +#include LILY_PUSH_TEST() #define LILY_FILE_END |