commit 22261c3d4058e652969d5ef3032be00ee646aced
parent 535b978a53dec091d96badf9302ae2a8a25bb276
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Nov 2016 11:52:45 +0100
Add parsing tests
Diffstat:
4 files changed, 56 insertions(+), 18 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -87,10 +87,14 @@ if(NOT NO_TEST)
${SOLSTICE_SOURCE_DIR}/yaml/test_ok_0.yaml)
add_test(test_solstice_parser_ok_1 test_solstice_parser
${SOLSTICE_SOURCE_DIR}/yaml/test_ok_1.yaml)
+ add_test(test_solstice_parser_ok_2 test_solstice_parser
+ ${SOLSTICE_SOURCE_DIR}/yaml/test_ok_2.yaml)
add_test(test_solstice_parser_ko_0 test_solstice_parser -e
${SOLSTICE_SOURCE_DIR}/yaml/test_ko_0.yaml)
add_test(test_solstice_parser_ko_1 test_solstice_parser -e
${SOLSTICE_SOURCE_DIR}/yaml/test_ko_1.yaml)
+ add_test(test_solstice_parser_ko_2 test_solstice_parser -e
+ ${SOLSTICE_SOURCE_DIR}/yaml/test_ko_2.yaml)
endif()
################################################################################
diff --git a/src/yaml/test_ko_0.yaml b/src/yaml/test_ko_0.yaml
@@ -94,7 +94,7 @@ instance:
---
- instance:
object:
- material:
+ material:
matte: { reflectivity: 1 }
dummy: 123
cuboid: { size: [1, 2, 3] }
@@ -117,47 +117,47 @@ instance:
dummy: 1
---
- material: &front { matte: { reflectivity: 1 } }
-- material: &back { matte: { reflectivity: 0.5 } }
+- material: &back { matte: { reflectivity: 0.5 } }
- object: &cuboid
cuboid: { size: [1, 2, 3] }
- material:
+ material:
front: *front
back: *back
front: *front
- instance: { object: *cuboid }
---
- material: &front { matte: { reflectivity: 1 } }
-- material: &back { matte: { reflectivity: 0.5 } }
+- material: &back { matte: { reflectivity: 0.5 } }
- object: &cuboid
cuboid: { size: [1, 2, 3] }
- material:
+ material:
front: *front
- instance: { object: *cuboid }
---
- material: &front { matte: { reflectivity: 1 } }
-- material: &back { matte: { reflectivity: 0.5 } }
+- material: &back { matte: { reflectivity: 0.5 } }
- object: &cuboid
cuboid: { size: [1, 2, 3] }
- material:
+ material:
back: *back
- instance: { object: *cuboid }
---
- object: &cuboid
cuboid: { size: [1, 2, 3] }
- material:
- front:
+ material:
+ front:
matte: { reflectivity: 1 }
dummy: 1
- back:
+ back:
material: { matte: { reflectivity: 0.1 } }
- instance: { object: *cuboid }
---
- object: &cuboid
cuboid: { size: [1, 2, 3] }
- material:
- front:
+ material:
+ front:
matte: { reflectivity: 1 }
- back:
+ back:
matte: { reflectivity: 0.1 }
dummy: 1234
- instance: { object: *cuboid }
diff --git a/src/yaml/test_ko_2.yaml b/src/yaml/test_ko_2.yaml
@@ -0,0 +1,30 @@
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ obj: { path: }
+---
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ obj: { path: "my_path", dummy: 1 }
+---
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ obj:
+---
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ stl: { path: }
+---
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ stl: { path: "my_path", dummy: 1 }
+---
+- instance:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ stl:
+
diff --git a/src/yaml/test_ok_2.yaml b/src/yaml/test_ok_2.yaml
@@ -1,22 +1,26 @@
- instance:
- object:
+ object:
+ material: { matte: { reflectivity: 1 } }
+ stl: { path: path toward }
+---
+- instance:
+ object:
material: { matte: { reflectivity: 1 } }
obj: { path: "my_path" }
----
+---
- instance:
object:
material: { matte: { reflectivity: 1 } }
obj: { path: "path/path/path" }
transform: { translation: [1, 2, 3] }
----
+---
- instance:
object:
material: { matte: { reflectivity: 1 } }
obj: { path: "path/path/path" }
transform: { rotation: [0, 0, 0] }
----
+---
- instance:
object:
material: { matte: { reflectivity: 1 } }
stl: { path: "path/path/path" }
-