diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-12-19 14:11:57 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-12-19 14:11:57 +0100 |
| commit | 6a918f0827a6e8806f77e39e0348b1a2abed71f2 (patch) | |
| tree | 30e70bf0533e91a4aa9246de1dd3aa256c64d0c1 /lib/core/tests/flatten.cpp | |
| parent | 434607c33deab6ad91cfeb203050138c108958ed (diff) | |
| download | libs-lbm-6a918f0827a6e8806f77e39e0348b1a2abed71f2.tar.gz | |
Rewriting large portion for simpler approach
Diffstat (limited to 'lib/core/tests/flatten.cpp')
| -rw-r--r-- | lib/core/tests/flatten.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/core/tests/flatten.cpp b/lib/core/tests/flatten.cpp new file mode 100644 index 0000000..84b3fa4 --- /dev/null +++ b/lib/core/tests/flatten.cpp @@ -0,0 +1,22 @@ +#include <forstio/test/suite.hpp> + +#include "../c++/flatten.hpp" + +namespace { +namespace sch { +using namespace saw::schema; +} + +SAW_TEST("Flatten Index Stride"){ + using namespace kel; + + constexpr saw::data<sch::UInt64> zero = lbm::flatten_index<sch::UInt64,3u>::stride<0u>({{2u,4u,3u}}); + constexpr saw::data<sch::UInt64> one = lbm::flatten_index<sch::UInt64,3u>::stride<1u>({{2u,4u,3u}}); + constexpr saw::data<sch::UInt64> two = lbm::flatten_index<sch::UInt64,3u>::stride<2u>({{2u,4u,3u}}); + + SAW_EXPECT(zero.get() == 1u, "Zero is correct"); + SAW_EXPECT(one.get() == 2u, "Zero is correct"); + SAW_EXPECT(two.get() == 8u, "Zero is correct"); +} + +} |
