GCC Code Coverage Report


Directory: ./
File: openvdb_ax/openvdb_ax/test/integration/TestCrement.cc
Date: 2022-07-25 17:40:05
Exec Total Coverage
Lines: 169 169 100.0%
Functions: 14 14 100.0%
Branches: 263 532 49.4%

Line Branch Exec Source
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
4 #include "CompareGrids.h"
5 #include "TestHarness.h"
6
7 #include "../util.h"
8
9 #include <openvdb_ax/compiler/CustomData.h>
10 #include <openvdb_ax/Exceptions.h>
11
12 #include <cppunit/extensions/HelperMacros.h>
13
14 using namespace openvdb::points;
15
16
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
2 class TestCrement : public unittest_util::AXTestCase
17 {
18 public:
19
20
3/6
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 24 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 24 times.
✗ Branch 8 not taken.
72 std::string dir() const override { return GET_TEST_DIRECTORY(); }
21
22
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(TestCrement);
23
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(crementScalar);
24
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(crementComponent);
25
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();
26
27 void crementScalar();
28 void crementComponent();
29 };
30
31 CPPUNIT_TEST_SUITE_REGISTRATION(TestCrement);
32
33 void
34 1 TestCrement::crementScalar()
35 {
36 1 const std::string code = R"(
37 _T1_@test1 = ++_T1_@test2;
38 _T1_@test3 = _T1_@test4++;
39 _T1_@test5 = (_T1_@test6++, _T1_@test7++, ++_T1_@test6);
40 _T1_@test8 = (++_T1_@test6, ++_T1_@test7, _T1_@test6++);
41 ++_T1_@test9 = _T1_@test9;
42 )";
43
44 1 auto generate = [&](const auto& types) {
45
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 for (const auto& type : types) {
46
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 std::string repl = code;
47
2/4
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
5 unittest_util::replace(repl, "_T1_", type);
48
3/6
✓ 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.
10 this->registerTest(repl, "crement_inc." + type + ".ax");
49
3/6
✓ 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.
10 unittest_util::replace(repl, "++", "--");
50
3/6
✓ 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.
10 this->registerTest(repl, "crement_dec." + type + ".ax");
51 }
52 1 };
53
54
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 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 5 times.
✓ Branch 23 taken 1 times.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
6 generate(std::vector<std::string>{
55 "int16", "int32", "int64", "float", "double",
56 });
57
58
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
2 const auto names = unittest_util::nameSequence("test", 9);
59 const std::map<std::string, std::function<void(bool)>> expected = {
60 { "int16",
61 2 [&](bool inc){
62
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (inc)
63
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int16_t>(names,
64 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
65 { 2, 2, 2, 3, 6, 8, -1, 7, -3 });
66 else
67
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int16_t>(names,
68 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
69 { 0, 0, 2, 1, 2, 0, -5, 1, -5 });
70 2 },
71 },
72 { "int32",
73 2 [&](bool inc){
74
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (inc)
75
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int32_t>(names,
76 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
77 { 2, 2, 2, 3, 6, 8, -1, 7, -3 });
78 else
79
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int32_t>(names,
80 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
81 { 0, 0, 2, 1, 2, 0, -5, 1, -5 });
82 2 },
83 },
84 { "int64",
85 2 [&](bool inc){
86
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (inc)
87
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int64_t>(names,
88 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
89 { 2, 2, 2, 3, 6, 8, -1, 7, -3 });
90 else
91
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<int64_t>(names,
92 { 0, 1, -1, 2, -3, 4, -3, 4, -4 },
93 { 0, 0, 2, 1, 2, 0, -5, 1, -5 });
94 2 },
95 },
96 { "float",
97 2 [&](bool inc){
98
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (inc)
99
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<float>(names,
100 { 0.1f, 1.4f, -1.9f, 2.5f, -3.3f, 4.5f, -3.3f, 4.7f, -4.8f },
101 { (1.4f+1.0f),
102 (1.4f+1.0f), 2.5f,
103 (2.5f+1.0f),
104 (4.5f+1.0f+1.0f),
105 (4.5f+1.0f+1.0f+1.0f+1.0f),
106 (-3.3f+1.0f+1.0f),
107 (4.5f+1.0f+1.0f+1.0f),
108 (-4.8f+1.0f) });
109 else
110
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<float>(names,
111 { 0.1f, 1.4f, -1.9f, 2.5f, -3.3f, 4.5f, -3.3f, 4.7f, -4.8f },
112 { (1.4f-1.0f),
113 (1.4f-1.0f), 2.5f,
114 (2.5f-1.0f),
115 (4.5f-1.0f-1.0f),
116 (4.5f-1.0f-1.0f-1.0f-1.0f),
117 (-3.3f-1.0f-1.0f),
118 (4.5f-1.0f-1.0f-1.0f),
119 (-4.8f-1.0f) });
120 2 },
121 },
122 { "double",
123 2 [&](bool inc){
124
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (inc)
125
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<double>(names,
126 { 0.1, 1.4, -1.9, 2.5, -3.3, 4.5, -3.3, 4.7, -4.8 },
127 { (1.4+1.0),
128 (1.4+1.0), 2.5,
129 (2.5+1.0),
130 (4.5+1.0+1.0),
131 (4.5+1.0+1.0+1.0+1.0),
132 (-3.3+1.0+1.0),
133 (4.5+1.0+1.0+1.0),
134 (-4.8+1.0) });
135 else
136
4/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 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
3 mHarness.addAttributes<double>(names,
137 { 0.1, 1.4, -1.9, 2.5, -3.3, 4.5, -3.3, 4.7, -4.8 },
138 { (1.4-1.0),
139 (1.4-1.0), 2.5,
140 (2.5-1.0),
141 (4.5-1.0-1.0),
142 (4.5-1.0-1.0-1.0-1.0),
143 (-3.3-1.0-1.0),
144 (4.5-1.0-1.0-1.0),
145 (-4.8-1.0) });
146 2 },
147 },
148
6/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 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
12 };
149
150
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 for (const auto& expc : expected) {
151
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 mHarness.reset();
152
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 expc.second.operator()(true); // increment
153
3/6
✓ 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.
10 this->execute("crement_inc." + expc.first + ".ax");
154
155
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 mHarness.reset();
156
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 expc.second.operator()(false); // decrement
157
3/6
✓ 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.
10 this->execute("crement_dec." + expc.first + ".ax");
158 }
159 1 }
160
161
162 void
163 1 TestCrement::crementComponent()
164 {
165 // Just tests the first two components of every container
166 1 const std::string code = R"(
167 _T1_@_A1_[0] = ++_T1_@_A2_[0];
168 _T1_@_A1_[1] = _T1_@_A2_[1]++;
169 )";
170
171 1 auto generate = [&](const auto& types) {
172 std::string repl;
173
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 1 times.
14 for (const auto& type : types) {
174
1/2
✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
13 std::string tmp = code;
175
2/4
✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
13 unittest_util::replace(tmp, "_T1_", type);
176
4/8
✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 13 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 13 times.
✗ Branch 11 not taken.
26 unittest_util::replace(tmp, "_A1_", "test" + type + "1");
177
5/10
✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 13 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 13 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 13 times.
✗ Branch 16 not taken.
26 unittest_util::replace(tmp, "_A2_", "test" + type + "2");
178 repl += tmp;
179 }
180
181
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->registerTest(repl, "crement_inc.component.ax");
182
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 unittest_util::replace(repl, "++", "--");
183
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
2 this->registerTest(repl, "crement_dec.component.ax");
184 1 };
185
186
17/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 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.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 1 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 1 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 1 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 13 times.
✓ Branch 47 taken 1 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
14 generate(std::vector<std::string>{
187 "vec2i", "vec2f", "vec2d",
188 "vec3i", "vec3f", "vec3d",
189 "vec4i", "vec4f", "vec4d",
190 "mat3f", "mat3d",
191 "mat4f", "mat4d"
192 });
193
194 const std::map<std::string, std::function<void()>> expected = {
195 { "inc",
196 1 [&](){
197
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<int32_t>>("testvec2i1", openvdb::math::Vec2<int32_t>(0,1));
198
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<int32_t>>("testvec2i2",
199 1 openvdb::math::Vec2<int32_t>(-1,1), openvdb::math::Vec2<int32_t>(0,2));
200
201
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<float>>("testvec2f1", openvdb::math::Vec2<float>(-1.1f+1.0f, 1.1f));
202
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<float>>("testvec2f2",
203 1 openvdb::math::Vec2<float>(-1.1f,1.1f), openvdb::math::Vec2<float>(-1.1f+1.0f, 1.1f+1.0f));
204
205
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<double>>("testvec2d1", openvdb::math::Vec2<double>(-1.1+1.0, 1.1));
206
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<double>>("testvec2d2",
207 1 openvdb::math::Vec2<double>(-1.1,1.1), openvdb::math::Vec2<double>(-1.1+1.0, 1.1+1.0));
208
209
210
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<int32_t>>("testvec3i1", openvdb::math::Vec3<int32_t>(0,1,0));
211
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<int32_t>>("testvec3i2",
212 1 openvdb::math::Vec3<int32_t>(-1,1,0), openvdb::math::Vec3<int32_t>(0,2,0));
213
214
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<float>>("testvec3f1", openvdb::math::Vec3<float>(-1.1f+1.0f, 1.1f, 0.0f));
215
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<float>>("testvec3f2",
216 1 openvdb::math::Vec3<float>(-1.1f,1.1f,0.0f), openvdb::math::Vec3<float>(-1.1f+1.0f, 1.1f+1.0f, 0.0f));
217
218
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<double>>("testvec3d1", openvdb::math::Vec3<double>(-1.1+1.0, 1.1, 0.0));
219
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<double>>("testvec3d2",
220 1 openvdb::math::Vec3<double>(-1.1,1.1,0.0), openvdb::math::Vec3<double>(-1.1+1.0, 1.1+1.0 ,0.0));
221
222
223
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<int32_t>>("testvec4i1", openvdb::math::Vec4<int32_t>(0,1,0,0));
224
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<int32_t>>("testvec4i2",
225 1 openvdb::math::Vec4<int32_t>(-1,1,0,0), openvdb::math::Vec4<int32_t>(0,2,0,0));
226
227
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<float>>("testvec4f1", openvdb::math::Vec4<float>(-1.1f+1.0f, 1.1f, 0.0f, 0.0f));
228
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<float>>("testvec4f2",
229 1 openvdb::math::Vec4<float>(-1.1f,1.1f,0.0f,0.0f), openvdb::math::Vec4<float>(-1.1f+1.0f, 1.1f+1.0f, 0.0f, 0.0f));
230
231
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<double>>("testvec4d1", openvdb::math::Vec4<double>(-1.1+1.0, 1.1, 0.0, 0.0));
232
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<double>>("testvec4d2",
233 1 openvdb::math::Vec4<double>(-1.1,1.1,0.0,0.0), openvdb::math::Vec4<double>(-1.1+1.0, 1.1+1.0, 0.0, 0.0));
234
235 auto getmat = [](auto x, auto a, auto b) -> decltype(x) {
236 20 x = decltype(x)::zero();
237 12 x(0,0) = a;
238 12 x(0,1) = b;
239 12 return x;
240 };
241
242
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat3<float>>("testmat3f1", getmat(openvdb::math::Mat3<float>(), -1.1f+1.0f, 1.1f));
243
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat3<float>>("testmat3f2",
244
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat3<float>(),-1.1f,1.1f),
245 1 getmat(openvdb::math::Mat3<float>(),-1.1f+1.0f,1.1f+1.0f));
246
247
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat3<double>>("testmat3d1", getmat(openvdb::math::Mat3<double>(), -1.1+1.0, 1.1));
248
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat3<double>>("testmat3d2",
249
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat3<double>(),-1.1,1.1),
250 1 getmat(openvdb::math::Mat3<double>(),-1.1+1.0, 1.1+1.0));
251
252
253
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat4<float>>("testmat4f1", getmat(openvdb::math::Mat4<float>(), -1.1f+1.0f, 1.1f));
254
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat4<float>>("testmat4f2",
255
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat4<float>(),-1.1f,1.1f),
256 1 getmat(openvdb::math::Mat4<float>(),-1.1f+1.0f,1.1f+1.0f));
257
258
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat4<double>>("testmat4d1", getmat(openvdb::math::Mat4<double>(), -1.1+1.0, 1.1));
259
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat4<double>>("testmat4d2",
260
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat4<double>(),-1.1,1.1),
261 1 getmat(openvdb::math::Mat4<double>(),-1.1+1.0, 1.1+1.0));
262 1 }
263 },
264 { "dec",
265 1 [&](){
266
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<int32_t>>("testvec2i1", openvdb::math::Vec2<int32_t>(-2,1));
267
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<int32_t>>("testvec2i2",
268 1 openvdb::math::Vec2<int32_t>(-1,1), openvdb::math::Vec2<int32_t>(-2,0));
269
270
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<float>>("testvec2f1", openvdb::math::Vec2<float>(-1.1f-1.0f, 1.1f));
271
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<float>>("testvec2f2",
272 1 openvdb::math::Vec2<float>(-1.1f,1.1f), openvdb::math::Vec2<float>(-1.1f-1.0f, 1.1f-1.0f));
273
274
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<double>>("testvec2d1", openvdb::math::Vec2<double>(-1.1-1.0, 1.1));
275
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec2<double>>("testvec2d2",
276 1 openvdb::math::Vec2<double>(-1.1,1.1), openvdb::math::Vec2<double>(-1.1-1.0, 1.1-1.0));
277
278
279
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<int32_t>>("testvec3i1", openvdb::math::Vec3<int32_t>(-2,1,0));
280
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<int32_t>>("testvec3i2",
281 1 openvdb::math::Vec3<int32_t>(-1,1,0), openvdb::math::Vec3<int32_t>(-2,0,0));
282
283
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<float>>("testvec3f1", openvdb::math::Vec3<float>(-1.1f-1.0f, 1.1f, 0.0f));
284
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<float>>("testvec3f2",
285 1 openvdb::math::Vec3<float>(-1.1f,1.1f,0.0f), openvdb::math::Vec3<float>(-1.1f-1.0f, 1.1f-1.0f, 0.0f));
286
287
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<double>>("testvec3d1", openvdb::math::Vec3<double>(-1.1-1.0, 1.1, 0.0));
288
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec3<double>>("testvec3d2",
289 1 openvdb::math::Vec3<double>(-1.1,1.1,0.0), openvdb::math::Vec3<double>(-1.1-1.0, 1.1-1.0 ,0.0));
290
291
292
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<int32_t>>("testvec4i1", openvdb::math::Vec4<int32_t>(-2,1,0,0));
293
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<int32_t>>("testvec4i2",
294 1 openvdb::math::Vec4<int32_t>(-1,1,0,0), openvdb::math::Vec4<int32_t>(-2,0,0,0));
295
296
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<float>>("testvec4f1", openvdb::math::Vec4<float>(-1.1f-1.0f, 1.1f, 0.0f, 0.0f));
297
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<float>>("testvec4f2",
298 1 openvdb::math::Vec4<float>(-1.1f,1.1f,0.0f,0.0f), openvdb::math::Vec4<float>(-1.1f-1.0f, 1.1f-1.0f, 0.0f, 0.0f));
299
300
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<double>>("testvec4d1", openvdb::math::Vec4<double>(-1.1-1.0, 1.1, 0.0, 0.0));
301
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 mHarness.addAttribute<openvdb::math::Vec4<double>>("testvec4d2",
302 1 openvdb::math::Vec4<double>(-1.1,1.1,0.0,0.0), openvdb::math::Vec4<double>(-1.1-1.0, 1.1-1.0, 0.0, 0.0));
303
304
305 auto getmat = [](auto x, auto a, auto b) -> decltype(x) {
306 20 x = decltype(x)::zero();
307 12 x(0,0) = a;
308 12 x(0,1) = b;
309 12 return x;
310 };
311
312
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat3<float>>("testmat3f1", getmat(openvdb::math::Mat3<float>(), -1.1f-1.0f, 1.1f));
313
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat3<float>>("testmat3f2",
314
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat3<float>(),-1.1f,1.1f),
315 1 getmat(openvdb::math::Mat3<float>(),-1.1f-1.0f,1.1f-1.0f));
316
317
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat3<double>>("testmat3d1", getmat(openvdb::math::Mat3<double>(), -1.1-1.0, 1.1));
318
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat3<double>>("testmat3d2",
319
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat3<double>(),-1.1,1.1),
320 1 getmat(openvdb::math::Mat3<double>(),-1.1-1.0, 1.1-1.0));
321
322
323
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat4<float>>("testmat4f1", getmat(openvdb::math::Mat4<float>(), -1.1f-1.0f, 1.1f));
324
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat4<float>>("testmat4f2",
325
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat4<float>(),-1.1f,1.1f),
326 1 getmat(openvdb::math::Mat4<float>(),-1.1f-1.0f,1.1f-1.0f));
327
328
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 mHarness.addAttribute<openvdb::math::Mat4<double>>("testmat4d1", getmat(openvdb::math::Mat4<double>(), -1.1-1.0, 1.1));
329
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 mHarness.addAttribute<openvdb::math::Mat4<double>>("testmat4d2",
330
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 getmat(openvdb::math::Mat4<double>(),-1.1,1.1),
331 1 getmat(openvdb::math::Mat4<double>(),-1.1-1.0, 1.1-1.0));
332 1 }
333 }
334
3/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
6 };
335
336
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
3 for (const auto& expc : expected) {
337
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 mHarness.reset();
338
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 expc.second.operator()();
339
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
4 this->execute("crement_" + expc.first + ".component.ax");
340 }
341 1 }
342
343
344