Skip to content

Commit 3048154

Browse files
ferdymercuryguitargeek
authored andcommitted
[math] test structured bindings
1 parent a9585ba commit 3048154

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

math/genvector/test/testGenVector.cxx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ int testVector3D() {
153153
vg4 = vg - vl;
154154
#endif
155155

156+
// test structured bindings
157+
auto const [x, y, z] = vg;
158+
iret |= (x != vg.x());
159+
iret |= (y != vg.y());
160+
iret |= (z != vg.z());
156161

157162
if (iret == 0) std::cout << "\t\t\t\t\tOK\n";
158163
else std::cout << "\t\t\t\tFAILED\n";
@@ -284,6 +289,10 @@ int testVector2D() {
284289
vg4 = vg - vl;
285290
#endif
286291

292+
// test structured bindings
293+
auto const [x, y] = vg;
294+
iret |= (x != vg.x());
295+
iret |= (y != vg.y());
287296

288297
if (iret == 0) std::cout << "\t\t\t\tOK\n";
289298
else std::cout << "\t\t\tFAILED\n";
@@ -807,6 +816,14 @@ int testLorentzVector()
807816
// TLorentzVector t1, t2;
808817
// t1.SetPtEtaPhiE(1,2,3,4); t2.SetPtEtaPhiE(5,6,7,8);
809818
// t1.DeltaR(t2)
819+
820+
// test structured bindings
821+
auto const [x, y, z, E] = v1;
822+
iret |= (x != v1.X());
823+
iret |= (y != v1.Y());
824+
iret |= (z != v1.Z());
825+
iret |= (E != v1.E());
826+
810827
if (iret == 0)
811828
std::cout << "\t\t\tOK\n";
812829
else

0 commit comments

Comments
 (0)