summaryrefslogtreecommitdiff
path: root/lib/tests/iterator.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-10-18 18:01:14 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-10-18 18:01:14 +0200
commit24bf28a8fb9cc8c3a90b77de9b60728bece7885d (patch)
treedfcbfcb8775bf96847d4a187695158b968902889 /lib/tests/iterator.cpp
parenta980da34513a9ad41e309e66432fcb80ddaf2e31 (diff)
downloadlibs-lbm-24bf28a8fb9cc8c3a90b77de9b60728bece7885d.tar.gz
Moving project structure for more less compilation
Diffstat (limited to 'lib/tests/iterator.cpp')
-rw-r--r--lib/tests/iterator.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/tests/iterator.cpp b/lib/tests/iterator.cpp
new file mode 100644
index 0000000..cd1cb7c
--- /dev/null
+++ b/lib/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,1u}});
+}
+}