diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-07 19:05:48 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-07 19:05:48 +0100 |
| commit | d2a6c799e2e6aaf58e04ef1304e5cef79f5b2a62 (patch) | |
| tree | 84c38bb076197e9eef6187ac5ea6d41da18905f6 /modules/codec/tests/data.cpp | |
| parent | 2e836ead5c10f00917560e9a98d46b59b2f977d4 (diff) | |
| download | forstio-forstio-d2a6c799e2e6aaf58e04ef1304e5cef79f5b2a62.tar.gz | |
Adding proper Booldev
Diffstat (limited to 'modules/codec/tests/data.cpp')
| -rw-r--r-- | modules/codec/tests/data.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/codec/tests/data.cpp b/modules/codec/tests/data.cpp index a686b6d..57c56d3 100644 --- a/modules/codec/tests/data.cpp +++ b/modules/codec/tests/data.cpp @@ -10,6 +10,27 @@ using Int32Array = Array< >; } +SAW_TEST("Data Native/Bool"){ + using namespace saw; + + data<sch::Bool> t{true}; + data<sch::Bool> f; + + SAW_EXPECT(t.get(), "Should hold true"); + SAW_EXPECT(!f.get(), "Should default to false"); + + SAW_EXPECT((t != f), "Should not be equal"); + SAW_EXPECT(((t && f).get() == false), "Wrong conjunction"); + SAW_EXPECT(((t || f).get() == true), "Wrong disjunction"); + SAW_EXPECT(((!f).get() == true), "Wrong negation"); + + f.set(true); + SAW_EXPECT((t == f), "Should be equal"); + + constexpr data<sch::Bool> ct{true}; + static_assert(ct.get(), "Should be usable at compile time"); +} + SAW_TEST("Data Native/Array Access with Data Native"){ using namespace saw; |
