summaryrefslogtreecommitdiff
path: root/lib/core/tests/memory.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-02-17 18:29:22 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-02-17 18:29:22 +0100
commitdcee24278ed28d21cd3addffeeb8e5f9f7248602 (patch)
treed590ede2996f04f69e2c4521019ae5b1bedd05df /lib/core/tests/memory.cpp
parentbb90083ca62483a1cf0e1b72dfb96e05701035ef (diff)
downloadlibs-lbm-dev.tar.gz
End of dayHEADmasterdev
Diffstat (limited to 'lib/core/tests/memory.cpp')
-rw-r--r--lib/core/tests/memory.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/core/tests/memory.cpp b/lib/core/tests/memory.cpp
new file mode 100644
index 0000000..27cd938
--- /dev/null
+++ b/lib/core/tests/memory.cpp
@@ -0,0 +1,18 @@
+#include <forstio/test/suite.hpp>
+
+#include "../c++/memory.hpp"
+
+namespace {
+namespace sch {
+using namespace saw::schema;
+}
+
+SAW_TEST("Memory Estimate"){
+ using namespace kel::lbm;
+
+ SAW_EXPECT((memory_estimate<sch::Float32>().get() == 4u), std::string{"Float32 isn't 4 bytes, but "} + std::to_string(memory_estimate<sch::Float32>().get()) );
+ SAW_EXPECT((memory_estimate<sch::FixedArray<sch::Float32,5u,3u>>().get() == 60u), "FixedArray<Float32,5u,3u> isn't 60 bytes");
+ SAW_EXPECT((memory_estimate<sch::FixedArray<sch::Float32,5u,3u>, sch::UInt8>().get() == 61u), "FixedArray<Float32,5u,3u> + UInt8 isn't 61 bytes");
+}
+
+}