Line | Branch | Exec | Source |
---|---|---|---|
1 | // Copyright Contributors to the OpenVDB Project | ||
2 | // SPDX-License-Identifier: MPL-2.0 | ||
3 | |||
4 | #include "TestHarness.h" | ||
5 | #include "../util.h" | ||
6 | |||
7 | #include <openvdb_ax/ax.h> | ||
8 | #include <openvdb_ax/codegen/Types.h> | ||
9 | #include <openvdb_ax/codegen/Functions.h> | ||
10 | #include <openvdb_ax/codegen/FunctionRegistry.h> | ||
11 | #include <openvdb_ax/codegen/FunctionTypes.h> | ||
12 | #include <openvdb_ax/compiler/PointExecutable.h> | ||
13 | #include <openvdb_ax/compiler/VolumeExecutable.h> | ||
14 | |||
15 | #include <openvdb/points/AttributeArray.h> | ||
16 | #include <openvdb/points/PointConversion.h> | ||
17 | #include <openvdb/points/PointGroup.h> | ||
18 | |||
19 | #include <cppunit/extensions/HelperMacros.h> | ||
20 | |||
21 |
2/4✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
7 | class TestVDBFunctions : public unittest_util::AXTestCase |
22 | { | ||
23 | public: | ||
24 |
3/6✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
|
4 | CPPUNIT_TEST_SUITE(TestVDBFunctions); |
25 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(addremovefromgroup); |
26 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(deletepoint); |
27 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(getcoord); |
28 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(getvoxelpws); |
29 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(ingroupOrder); |
30 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(ingroup); |
31 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
6 | CPPUNIT_TEST(testValidContext); |
32 |
4/8✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
|
4 | CPPUNIT_TEST_SUITE_END(); |
33 | |||
34 | void addremovefromgroup(); | ||
35 | void deletepoint(); | ||
36 | void getcoord(); | ||
37 | void getvoxelpws(); | ||
38 | void ingroupOrder(); | ||
39 | void ingroup(); | ||
40 | void testValidContext(); | ||
41 | }; | ||
42 | |||
43 | CPPUNIT_TEST_SUITE_REGISTRATION(TestVDBFunctions); | ||
44 | |||
45 | void | ||
46 | 1 | TestVDBFunctions::addremovefromgroup() | |
47 | { | ||
48 | const std::vector<openvdb::math::Vec3s> positions = { | ||
49 | {1, 1, 1}, | ||
50 | {1, 2, 1}, | ||
51 | {2, 1, 1}, | ||
52 | {2, 2, 1}, | ||
53 | 1 | }; | |
54 | |||
55 | const float voxelSize = 1.0f; | ||
56 | const openvdb::math::Transform::ConstPtr transform = | ||
57 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::math::Transform::createLinearTransform(voxelSize); |
58 | const openvdb::points::PointAttributeVector<openvdb::math::Vec3s> pointList(positions); | ||
59 | |||
60 | openvdb::tools::PointIndexGrid::Ptr pointIndexGrid = | ||
61 | openvdb::tools::createPointIndexGrid<openvdb::tools::PointIndexGrid>( | ||
62 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | pointList, *transform); |
63 | |||
64 | openvdb::points::PointDataGrid::Ptr dataGrid = | ||
65 | openvdb::points::createPointDataGrid<openvdb::points::NullCodec, openvdb::points::PointDataGrid>( | ||
66 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | *pointIndexGrid, pointList, *transform); |
67 | |||
68 | openvdb::points::PointDataTree& dataTree = dataGrid->tree(); | ||
69 | |||
70 | // apppend a new attribute for stress testing | ||
71 | |||
72 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::appendAttribute(dataTree, "existingTestAttribute", 2); |
73 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::appendGroup(dataTree, "existingTestGroup"); |
74 | |||
75 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
1 | const std::vector<short> membershipTestGroup1{1, 0, 1, 0}; |
76 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::setGroup(dataTree, pointIndexGrid->tree(), membershipTestGroup1, "existingTestGroup"); |
77 | |||
78 | // second pre-existing group. | ||
79 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::appendGroup(dataTree, "existingTestGroup2"); |
80 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::setGroup(dataTree, "existingTestGroup2", false); |
81 | |||
82 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | const std::string code = unittest_util::loadText("test/snippets/vdb_functions/addremovefromgroup"); |
83 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | openvdb::ax::run(code.c_str(), *dataGrid); |
84 | |||
85 | auto leafIter = dataTree.cbeginLeaf(); | ||
86 | |||
87 | const openvdb::points::AttributeSet& attributeSet = leafIter->attributeSet(); | ||
88 | const openvdb::points::AttributeSet::Descriptor& desc = attributeSet.descriptor(); | ||
89 | |||
90 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 times.
|
10 | for (size_t i = 1; i <= 9; i++) { |
91 |
1/2✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
|
9 | const std::string groupName = "newTestGroup" + std::to_string(i); |
92 |
8/16✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 9 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 9 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 9 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 9 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 9 times.
✗ Branch 23 not taken.
|
18 | CPPUNIT_ASSERT_MESSAGE(groupName + " doesn't exist", desc.hasGroup(groupName)); |
93 | } | ||
94 | |||
95 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::GroupHandle newTestGroupHandle = leafIter->groupHandle("newTestGroup9"); |
96 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!newTestGroupHandle.get(0)); |
97 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(newTestGroupHandle.get(1)); |
98 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!newTestGroupHandle.get(2)); |
99 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(newTestGroupHandle.get(3)); |
100 | |||
101 | // other new groups should be untouched | ||
102 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 times.
|
9 | for (size_t i = 1; i <= 8; i++) { |
103 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | openvdb::points::GroupHandle handle = leafIter->groupHandle("newTestGroup" + std::to_string(i)); |
104 |
7/14✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 8 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 8 times.
✗ Branch 20 not taken.
|
8 | CPPUNIT_ASSERT(handle.get(0)); |
105 |
7/14✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 8 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 8 times.
✗ Branch 20 not taken.
|
8 | CPPUNIT_ASSERT(handle.get(1)); |
106 |
7/14✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 8 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 8 times.
✗ Branch 20 not taken.
|
8 | CPPUNIT_ASSERT(handle.get(2)); |
107 |
7/14✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 8 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 8 times.
✗ Branch 20 not taken.
|
8 | CPPUNIT_ASSERT(handle.get(3)); |
108 | } | ||
109 | |||
110 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::GroupHandle existingTestGroupHandle = leafIter->groupHandle("existingTestGroup"); |
111 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(existingTestGroupHandle.get(0)); |
112 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!existingTestGroupHandle.get(1)); |
113 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(existingTestGroupHandle.get(2)); |
114 |
8/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
1 | CPPUNIT_ASSERT(!existingTestGroupHandle.get(3)); |
115 | |||
116 | // membership of this group should now mirror exisingTestGroup | ||
117 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::GroupHandle existingTestGroup2Handle = leafIter->groupHandle("existingTestGroup2"); |
118 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(existingTestGroup2Handle.get(0)); |
119 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!existingTestGroup2Handle.get(1)); |
120 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(existingTestGroup2Handle.get(2)); |
121 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!existingTestGroup2Handle.get(3)); |
122 | |||
123 | // check that "nonExistentGroup" was _not_ added to the tree, as it is removed from but not present | ||
124 |
8/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | CPPUNIT_ASSERT(!desc.hasGroup("nonExistentGroup")); |
125 | |||
126 | // now check 2 new attributes added to tree | ||
127 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | openvdb::points::AttributeHandle<int> testResultAttributeHandle1(*attributeSet.get("newTestAttribute1")); |
128 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
3 | openvdb::points::AttributeHandle<int> testResultAttributeHandle2(*attributeSet.get("newTestAttribute2")); |
129 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
|
5 | for (openvdb::Index i = 0;i < 4; i++) { |
130 |
7/14✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 4 times.
✗ Branch 20 not taken.
|
4 | CPPUNIT_ASSERT(testResultAttributeHandle1.get(i)); |
131 | } | ||
132 | |||
133 | // should match "existingTestGroup" | ||
134 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(testResultAttributeHandle2.get(0)); |
135 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!testResultAttributeHandle2.get(1)); |
136 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(testResultAttributeHandle2.get(2)); |
137 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(!testResultAttributeHandle2.get(3)); |
138 | |||
139 | // pre-existing attribute should still be present with the correct value | ||
140 | |||
141 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
|
2 | for (; leafIter; ++leafIter) { |
142 | openvdb::points::AttributeHandle<int> | ||
143 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
1 | handle(leafIter->attributeArray("existingTestAttribute")); |
144 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT(handle.isUniform()); |
145 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(2, handle.get(0)); |
146 | } | ||
147 | 1 | } | |
148 | |||
149 | void | ||
150 | 1 | TestVDBFunctions::deletepoint() | |
151 | { | ||
152 | // run first, should not modify grid as attribute doesn't exist | ||
153 | // @todo - need to massively improve this test | ||
154 | |||
155 | 1 | mHarness.testVolumes(false); | |
156 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.addAttribute<int>("delete", 0, 0); |
157 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.executeCode("test/snippets/vdb_functions/deletepoint"); |
158 |
7/14✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
|
2 | AXTESTS_STANDARD_ASSERT(); |
159 | |||
160 | 1 | mHarness.reset(); | |
161 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | mHarness.addInputAttribute<int>("delete", 1); |
162 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
|
3 | for (auto& grid : mHarness.mOutputPointGrids) { |
163 | 2 | grid->clear(); | |
164 | } | ||
165 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.executeCode("test/snippets/vdb_functions/deletepoint"); |
166 |
7/14✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
|
2 | AXTESTS_STANDARD_ASSERT(); |
167 | 1 | } | |
168 | |||
169 | void | ||
170 | 1 | TestVDBFunctions::getcoord() | |
171 | { | ||
172 | // create 3 test grids | ||
173 | 2 | std::vector<openvdb::Int32Grid::Ptr> testGrids(3); | |
174 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | openvdb::math::Transform::Ptr transform = openvdb::math::Transform::createLinearTransform(0.1); |
175 | |||
176 | int i = 0; | ||
177 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
|
4 | for (auto& grid : testGrids) { |
178 | 3 | grid = openvdb::Int32Grid::create(); | |
179 |
2/4✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
|
6 | grid->setTransform(transform); |
180 |
4/8✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
|
6 | grid->setName("a" + std::to_string(i)); |
181 | openvdb::Int32Grid::Accessor accessor = grid->getAccessor(); | ||
182 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(1, 2, 3), 0); |
183 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(1, 10, 3), 0); |
184 |
1/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(-1, 1, 10), 0); |
185 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | ++i; |
186 | } | ||
187 | |||
188 | // convert to GridBase::Ptr | ||
189 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
2 | openvdb::GridPtrVec testGridsBase(3); |
190 | 1 | std::copy(testGrids.begin(), testGrids.end(), testGridsBase.begin()); | |
191 | |||
192 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | const std::string code = unittest_util::loadText("test/snippets/vdb_functions/getcoord"); |
193 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | openvdb::ax::run(code.c_str(), testGridsBase); |
194 | |||
195 | // each grid has 3 active voxels. These vectors hold the expected values of those voxels | ||
196 | // for each grid | ||
197 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | std::vector<openvdb::Vec3I> expectedVoxelVals(3); |
198 | 1 | expectedVoxelVals[0] = openvdb::Vec3I(1, 1, -1); | |
199 | 1 | expectedVoxelVals[1] = openvdb::Vec3I(2, 10, 1); | |
200 | 1 | expectedVoxelVals[2] = openvdb::Vec3I(3, 3, 10); | |
201 | |||
202 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
2 | std::vector<openvdb::Int32Grid::Ptr> expectedGrids(3); |
203 | |||
204 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
|
4 | for (size_t i = 0; i < 3; i++) { |
205 | openvdb::Int32Grid::Ptr grid = openvdb::Int32Grid::create(); | ||
206 |
2/4✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
|
6 | grid->setTransform(transform); |
207 |
5/12✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 3 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
|
6 | grid->setName("a" + std::to_string(i) + "_expected"); |
208 | |||
209 | openvdb::Int32Grid::Accessor accessor = grid->getAccessor(); | ||
210 | const openvdb::Vec3I& expectedVals = expectedVoxelVals[i]; | ||
211 | |||
212 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(1, 2 ,3), expectedVals[0]); |
213 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(1, 10, 3), expectedVals[1]); |
214 |
1/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
3 | accessor.setValueOn(openvdb::Coord(-1, 1, 10), expectedVals[2]); |
215 | |||
216 | expectedGrids[i] = grid; | ||
217 | } | ||
218 | |||
219 | // check grids | ||
220 | bool check = true; | ||
221 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | std::stringstream outMessage; |
222 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
|
4 | for (size_t i = 0; i < 3; i++){ |
223 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
6 | std::stringstream stream; |
224 | 3 | unittest_util::ComparisonSettings settings; | |
225 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
6 | unittest_util::ComparisonResult result(stream); |
226 | |||
227 |
1/2✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
|
3 | check &= unittest_util::compareGrids(result, *testGrids[i], *expectedGrids[i], settings, nullptr); |
228 | |||
229 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
|
3 | if (!check) outMessage << stream.str() << std::endl; |
230 | } | ||
231 | |||
232 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
|
2 | CPPUNIT_ASSERT_MESSAGE(outMessage.str(), check); |
233 | 1 | } | |
234 | |||
235 | void | ||
236 | 1 | TestVDBFunctions::getvoxelpws() | |
237 | { | ||
238 | 1 | mHarness.testPoints(false); | |
239 | 1 | mHarness.testSparseVolumes(false); // disable as getvoxelpws will densify | |
240 | 1 | mHarness.testDenseVolumes(true); | |
241 | |||
242 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.addAttribute<openvdb::Vec3f>("a", openvdb::Vec3f(10.0f), openvdb::Vec3f(0.0f)); |
243 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.executeCode("test/snippets/vdb_functions/getvoxelpws"); |
244 |
7/14✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
|
2 | AXTESTS_STANDARD_ASSERT(); |
245 | 1 | } | |
246 | |||
247 | void | ||
248 | 1 | TestVDBFunctions::ingroupOrder() | |
249 | { | ||
250 | // Test that groups inserted in a different alphabetical order are inferred | ||
251 | // correctly (a regression test for a previous issue) | ||
252 | 1 | mHarness.testVolumes(false); | |
253 | |||
254 |
9/18✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 3 times.
✓ Branch 20 taken 1 times.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
|
4 | mHarness.addExpectedAttributes<int>({"test", "groupTest", "groupTest2"}, {1,1,1}); |
255 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2 times.
✓ Branch 17 taken 1 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
|
3 | mHarness.addInputGroups({"b", "a"}, {false, true}); |
256 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 2 times.
✓ Branch 17 taken 1 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
|
3 | mHarness.addExpectedGroups({"b", "a"}, {false, true}); |
257 | |||
258 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mHarness.executeCode("test/snippets/vdb_functions/ingroup", nullptr, true); |
259 |
7/14✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
|
2 | AXTESTS_STANDARD_ASSERT(); |
260 | 1 | } | |
261 | |||
262 | void | ||
263 | 1 | TestVDBFunctions::ingroup() | |
264 | { | ||
265 | // test a tree with no groups | ||
266 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
|
1 | CPPUNIT_ASSERT(mHarness.mInputPointGrids.size() > 0); |
267 | openvdb::points::PointDataGrid::Ptr pointDataGrid1 = mHarness.mInputPointGrids.back(); | ||
268 | openvdb::points::PointDataTree& pointTree = pointDataGrid1->tree(); | ||
269 | |||
270 | // compile and execute | ||
271 | |||
272 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
2 | openvdb::ax::Compiler compiler; |
273 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | std::string code = unittest_util::loadText("test/snippets/vdb_functions/ingroup"); |
274 | openvdb::ax::PointExecutable::Ptr executable = | ||
275 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | compiler.compile<openvdb::ax::PointExecutable>(code); |
276 | |||
277 |
5/34✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
|
4 | CPPUNIT_ASSERT_NO_THROW(executable->execute(*pointDataGrid1)); |
278 | |||
279 | // the snippet of code adds "groupTest" and groupTest2 attributes which should both have the values | ||
280 | // "1" everywhere | ||
281 | |||
282 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
|
4 | for (auto leafIter = pointTree.cbeginLeaf(); leafIter; ++leafIter) { |
283 |
4/8✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
|
9 | openvdb::points::AttributeHandle<int> handle1(leafIter->attributeArray("groupTest")); |
284 |
3/6✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
9 | openvdb::points::AttributeHandle<int> handle2(leafIter->attributeArray("groupTest2")); |
285 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 3 times.
|
7 | for (auto iter = leafIter->beginIndexAll(); iter; ++iter) { |
286 |
5/10✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
|
4 | CPPUNIT_ASSERT_EQUAL(1, handle1.get(*iter)); |
287 |
6/12✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
✓ Branch 20 taken 4 times.
✗ Branch 21 not taken.
|
4 | CPPUNIT_ASSERT_EQUAL(1, handle2.get(*iter)); |
288 | } | ||
289 | } | ||
290 | |||
291 | // there should be no groups - ensure none have been added by accident by query code | ||
292 | auto leafIter = pointTree.cbeginLeaf(); | ||
293 | const openvdb::points::AttributeSet& attributeSet = leafIter->attributeSet(); | ||
294 | const openvdb::points::AttributeSet::Descriptor& descriptor1 = attributeSet.descriptor(); | ||
295 |
4/8✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), descriptor1.groupMap().size()); |
296 | |||
297 | // now we add a single group and run the test again | ||
298 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::points::appendGroup(pointTree, "testGroup"); |
299 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | setGroup(pointTree, "testGroup", false); |
300 | |||
301 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
2 | executable = compiler.compile<openvdb::ax::PointExecutable>(code); |
302 |
5/34✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
|
4 | CPPUNIT_ASSERT_NO_THROW(executable->execute(*pointDataGrid1)); |
303 | |||
304 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
|
4 | for (auto leafIter = pointTree.cbeginLeaf(); leafIter; ++leafIter) { |
305 |
4/8✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
|
9 | openvdb::points::AttributeHandle<int> handle1(leafIter->attributeArray("groupTest")); |
306 |
3/6✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
9 | openvdb::points::AttributeHandle<int> handle2(leafIter->attributeArray("groupTest2")); |
307 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 3 times.
|
7 | for (auto iter = leafIter->beginIndexAll(); iter; ++iter) { |
308 |
5/10✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
|
4 | CPPUNIT_ASSERT_EQUAL(1, handle1.get(*iter)); |
309 |
6/12✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
✓ Branch 20 taken 4 times.
✗ Branch 21 not taken.
|
4 | CPPUNIT_ASSERT_EQUAL(1, handle2.get(*iter)); |
310 | } | ||
311 | } | ||
312 | |||
313 | // for the next couple of tests we create a small tree with 4 points. We wish to test queries of a single group | ||
314 | // in a tree that has several groups | ||
315 | const std::vector<openvdb::math::Vec3s> positions = { | ||
316 | {1, 1, 1}, | ||
317 | {1, 2, 1}, | ||
318 | {2, 1, 1}, | ||
319 | {2, 2, 1}, | ||
320 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
1 | }; |
321 | |||
322 | const float voxelSize = 1.0f; | ||
323 | const openvdb::math::Transform::ConstPtr transform = | ||
324 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | openvdb::math::Transform::createLinearTransform(voxelSize); |
325 | const openvdb::points::PointAttributeVector<openvdb::math::Vec3s> pointList(positions); | ||
326 | |||
327 | openvdb::tools::PointIndexGrid::Ptr pointIndexGrid = | ||
328 | openvdb::tools::createPointIndexGrid<openvdb::tools::PointIndexGrid> | ||
329 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | (pointList, *transform); |
330 | |||
331 | openvdb::points::PointDataGrid::Ptr pointDataGrid2 = | ||
332 | openvdb::points::createPointDataGrid<openvdb::points::NullCodec, openvdb::points::PointDataGrid> | ||
333 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | (*pointIndexGrid, pointList, *transform); |
334 | |||
335 | openvdb::points::PointDataTree::Ptr pointDataTree2 = pointDataGrid2->treePtr(); | ||
336 | |||
337 | // add 9 groups. 8 groups can be added by using a single group attribute, but this requires adding another attribute | ||
338 | // and hence exercises the code better | ||
339 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 times.
|
10 | for (size_t i = 0; i < 9; i++) { |
340 |
2/4✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
18 | openvdb::points::appendGroup(*pointDataTree2, "testGroup" + std::to_string(i)); |
341 | } | ||
342 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
|
1 | std::vector<short> membershipTestGroup2{0, 0, 1, 0}; |
343 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | openvdb::points::setGroup(*pointDataTree2, pointIndexGrid->tree(), membershipTestGroup2, "testGroup2"); |
344 | |||
345 |
2/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
2 | executable = compiler.compile<openvdb::ax::PointExecutable>(code); |
346 |
5/34✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
|
4 | CPPUNIT_ASSERT_NO_THROW(executable->execute(*pointDataGrid2)); |
347 | |||
348 | auto leafIter2 = pointDataTree2->cbeginLeaf(); | ||
349 | const openvdb::points::AttributeSet& attributeSet2 = leafIter2->attributeSet(); | ||
350 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | openvdb::points::AttributeHandle<int> testResultAttributeHandle(*attributeSet2.get("groupTest2")); |
351 | |||
352 | // these should line up with the defined membership | ||
353 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(testResultAttributeHandle.get(0), 1); |
354 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(testResultAttributeHandle.get(1), 1); |
355 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(testResultAttributeHandle.get(2), 2); |
356 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(testResultAttributeHandle.get(3), 1); |
357 | |||
358 | // check that no new groups have been created or deleted | ||
359 | const openvdb::points::AttributeSet::Descriptor& descriptor2 = attributeSet2.descriptor(); | ||
360 |
4/8✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
|
1 | CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(9), descriptor2.groupMap().size()); |
361 | |||
362 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 times.
|
10 | for (size_t i = 0; i < 9; i++) { |
363 |
8/16✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 9 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 9 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 9 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 9 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 9 times.
✗ Branch 23 not taken.
|
27 | CPPUNIT_ASSERT(descriptor2.hasGroup("testGroup" + std::to_string(i))); |
364 | } | ||
365 | 1 | } | |
366 | |||
367 | void | ||
368 | 1 | TestVDBFunctions::testValidContext() | |
369 | { | ||
370 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | std::shared_ptr<llvm::LLVMContext> C(new llvm::LLVMContext); |
371 |
1/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
|
2 | openvdb::ax::Compiler compiler; |
372 | 1 | openvdb::ax::FunctionOptions ops; | |
373 | 1 | ops.mLazyFunctions = false; | |
374 | |||
375 | /// Generate code which calls the given function | ||
376 |
1/2✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
|
9 | auto generate = [&C](const openvdb::ax::codegen::Function::Ptr F, |
377 | 9 | const std::string& name) -> std::string | |
378 | { | ||
379 | std::vector<llvm::Type*> types; | ||
380 |
1/2✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
|
9 | F->types(types, *C); |
381 | |||
382 | std::string code; | ||
383 | std::string args; | ||
384 | size_t idx = 0; | ||
385 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 9 times.
|
12 | for (auto T : types) { |
386 | const std::string axtype = | ||
387 | openvdb::ax::ast::tokens::typeStringFromToken( | ||
388 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
|
3 | openvdb::ax::codegen::tokenFromLLVMType(T)); |
389 |
4/8✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
|
6 | code += axtype + " local" + std::to_string(idx) + ";\n"; |
390 |
2/4✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
|
6 | args += "local" + std::to_string(idx) + ","; |
391 | } | ||
392 | |||
393 | // remove last "," | ||
394 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 6 times.
|
9 | if (!args.empty()) args.pop_back(); |
395 |
2/4✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
27 | code += name + "(" + args + ");"; |
396 | 9 | return code; | |
397 | 1 | }; | |
398 | |||
399 | |||
400 | /// Test Volumes fails when trying to call Point Functions | ||
401 | { | ||
402 | openvdb::ax::codegen::FunctionRegistry::UniquePtr | ||
403 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | registry(new openvdb::ax::codegen::FunctionRegistry); |
404 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | openvdb::ax::codegen::insertVDBPointFunctions(*registry, &ops); |
405 | |||
406 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 times.
|
9 | for (auto& func : registry->map()) { |
407 | // Don't check internal functions | ||
408 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 4 times.
|
8 | if (func.second.isInternal()) continue; |
409 | |||
410 | const openvdb::ax::codegen::FunctionGroup* const ptr = func.second.function(); | ||
411 |
6/12✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
|
4 | CPPUNIT_ASSERT(ptr); |
412 | const auto& signatures = ptr->list(); | ||
413 |
6/12✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
|
4 | CPPUNIT_ASSERT(!signatures.empty()); |
414 | |||
415 | // Don't check C bindings | ||
416 | const auto F = signatures.front(); | ||
417 |
2/6✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
4 | if (dynamic_cast<const openvdb::ax::codegen::CFunctionBase*>(F.get())) continue; |
418 | |||
419 |
1/4✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
4 | const std::string code = generate(F, func.first); |
420 | |||
421 |
12/49✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 4 times.
✗ Branch 20 not taken.
✓ Branch 27 taken 4 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 4 times.
✗ Branch 31 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 4 times.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✓ Branch 48 taken 4 times.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✓ Branch 53 taken 4 times.
✗ Branch 54 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
|
28 | CPPUNIT_ASSERT_THROW_MESSAGE(ERROR_MSG("Expected Compiler Error", code), |
422 | compiler.compile<openvdb::ax::VolumeExecutable>(code), | ||
423 | openvdb::AXCompilerError); | ||
424 | } | ||
425 | } | ||
426 | |||
427 | /// Test Points fails when trying to call Volume Functions | ||
428 | { | ||
429 | openvdb::ax::codegen::FunctionRegistry::UniquePtr | ||
430 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | registry(new openvdb::ax::codegen::FunctionRegistry); |
431 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | openvdb::ax::codegen::insertVDBVolumeFunctions(*registry, &ops); |
432 | |||
433 |
2/2✓ Branch 0 taken 13 times.
✓ Branch 1 taken 1 times.
|
14 | for (auto& func : registry->map()) { |
434 | // Don't check internal functions | ||
435 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 5 times.
|
13 | if (func.second.isInternal()) continue; |
436 | |||
437 | const openvdb::ax::codegen::FunctionGroup* const ptr = func.second.function(); | ||
438 |
6/12✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 5 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 5 times.
✗ Branch 17 not taken.
|
5 | CPPUNIT_ASSERT(ptr); |
439 | const auto& signatures = ptr->list(); | ||
440 |
6/12✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 5 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 5 times.
✗ Branch 17 not taken.
|
5 | CPPUNIT_ASSERT(!signatures.empty()); |
441 | |||
442 | // Don't check C bindings | ||
443 | const auto F = signatures.front(); | ||
444 |
2/6✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
5 | if (dynamic_cast<const openvdb::ax::codegen::CFunctionBase*>(F.get())) continue; |
445 | |||
446 |
1/4✓ Branch 2 taken 5 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
5 | const std::string code = generate(F, func.first); |
447 | |||
448 |
12/49✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 5 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 5 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 5 times.
✗ Branch 20 not taken.
✓ Branch 27 taken 5 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 5 times.
✗ Branch 31 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 5 times.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✓ Branch 48 taken 5 times.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✓ Branch 53 taken 5 times.
✗ Branch 54 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
|
35 | CPPUNIT_ASSERT_THROW_MESSAGE(ERROR_MSG("Expected Compiler Error", code), |
449 | compiler.compile<openvdb::ax::PointExecutable>(code), | ||
450 | openvdb::AXCompilerError); | ||
451 | } | ||
452 | } | ||
453 | 1 | } | |
454 |