diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-03 15:37:25 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-03 15:37:25 +0200 |
commit | 6393b959829a1f7513f3daccbaeb9e275fc4ac0d (patch) | |
tree | 93dcab7399f955cc9a6bc27a91cdb9ad49f2faea /tests/iterator.cpp | |
parent | 6119b94098385da3983a82a3c1472991e9e2f467 (diff) |
Wrote minor iterator confirmation tests
Diffstat (limited to 'tests/iterator.cpp')
-rw-r--r-- | tests/iterator.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/iterator.cpp b/tests/iterator.cpp new file mode 100644 index 0000000..85037da --- /dev/null +++ b/tests/iterator.cpp @@ -0,0 +1,33 @@ +#include <forstio/test/suite.hpp> + +#include "../c++/iterator.hpp" + +#include <iostream> + +namespace { +namespace sch { +using namespace kel::lbm::sch; +} + +SAW_TEST("Iterate"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{3u,3u}}; + + lbm::iterate_over([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end); +} + +SAW_TEST("Iterate with Distance 1"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{4u,4u}}; + + lbm::iterate_over([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end, {1u}); +} +} |