summaryrefslogtreecommitdiff
path: root/src/geometry/geometry.test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/geometry/geometry.test.c')
-rw-r--r--src/geometry/geometry.test.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/geometry/geometry.test.c b/src/geometry/geometry.test.c
index 2c172f2..fd1f379 100644
--- a/src/geometry/geometry.test.c
+++ b/src/geometry/geometry.test.c
@@ -178,5 +178,50 @@ LILY_TEST("parse accessor")
#include LILY_PUSH_TEST()
+LILY_TEST("fail to read non-source tag")
+{
+ struct kai_tag_t *t = kai_parse_string(
+ "<tag />"
+ );
+
+ struct ka_source_t source;
+ int result = kai_read_source(&source, t);
+ CHECK_EQ(result, -1, "%d");
+
+ kai_tag_destroy(t);
+}
+#include LILY_PUSH_TEST()
+
+
+LILY_TEST("fail to read source tag with no specified id")
+{
+ struct kai_tag_t *t = kai_parse_string(
+ "<source />"
+ );
+
+ struct ka_source_t source;
+ int result = kai_read_source(&source, t);
+ CHECK_EQ(result, -1, "%d");
+
+ kai_tag_destroy(t);
+}
+#include LILY_PUSH_TEST()
+
+
+LILY_TEST("read source correctly")
+{
+ struct kai_tag_t *t = kai_parse_string(
+ "<source id=\"source\">"
+ " <float_array count=\"1\">0.0</float_array>"
+ " <technique_common>"
+ " <accessor count=\"1\" id=\"xxx\">"
+ " <param type=\"float\" />"
+ " </accessor>"
+ " </technique_common>"
+ "</source>"
+ );
+}
+
+
#define LILY_FILE_END
#include LILY_REGISTER_TESTS()