From 90acc8c3d29a7f3309aef212ae1548494aec494a Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Tue, 17 Sep 2024 18:07:04 +0200 Subject: wip --- modules/codec/tests/data_raw.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'modules/codec/tests') diff --git a/modules/codec/tests/data_raw.cpp b/modules/codec/tests/data_raw.cpp index 11e2c5e..26c2721 100644 --- a/modules/codec/tests/data_raw.cpp +++ b/modules/codec/tests/data_raw.cpp @@ -14,23 +14,29 @@ SAW_TEST("Data NativeRaw/Array of Primitives"){ using namespace saw; data prim{4u}; - prim.at(1u).set(0); + prim.at(0u).set(0); - auto a = prim.at(1u); + auto a = prim.at(0u); + auto b = prim.at(1u); + auto c = prim.at(2u); + auto d = prim.at(3u); a.set(5); + b.set(6); - auto b = prim.at(1u); // Check if it's a reference being manipulated SAW_EXPECT(a.get() == 5, "'a' has unexpected value."); - SAW_EXPECT(b.get() == 5, "'b' has unexpected value."); + SAW_EXPECT(b.get() == 6, "'b' has unexpected value."); - auto c = prim.at(1u); - c.set(10); + auto b1 = prim.at(1u); + b1.set(10); + c.set(-9); - SAW_EXPECT(a.get() == 10, "'a' has unexpected value."); + SAW_EXPECT(b1.get() == 10, "'b1' has unexpected value."); + SAW_EXPECT(a.get() == 5, "'a' has unexpected value."); SAW_EXPECT(b.get() == 10, "'b' has unexpected value."); - SAW_EXPECT(c.get() == 10, "'c' has unexpected value."); + SAW_EXPECT(c.get() == -9, "'c' has unexpected value."); + SAW_EXPECT(d.get() == 23, "'d' has unexpected value."); } } -- cgit v1.2.3