summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-06 00:03:00 -0500
committerbd <bdunahu@operationnull.com>2025-03-06 00:03:00 -0500
commit20fe698a4074df4abe02f14a1a14481770e90abc (patch)
treee1d14c2ea93c1a4e6d87f007575e744a472147e0 /tests
parente296a3a6ab782cb80b7091324b41bb78db6d3906 (diff)
Storage.view method, some initial tests
Diffstat (limited to 'tests')
-rw-r--r--tests/cache.cc3
-rw-r--r--tests/dram.cc4
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/cache.cc b/tests/cache.cc
index 6580563..3b3787d 100644
--- a/tests/cache.cc
+++ b/tests/cache.cc
@@ -4,5 +4,8 @@
TEST_CASE("Constructor initialize test 1", "[cache]")
{
Cache *c = new Cache(1, nullptr, 4);
+ std::array<signed int, 4> expected = {0, 0, 0, 0};
+ std::array<signed int, 4> actual = c->view(0, 1)[0];
+ CHECK(expected == actual);
delete c;
}
diff --git a/tests/dram.cc b/tests/dram.cc
index 21182f8..8d5d03b 100644
--- a/tests/dram.cc
+++ b/tests/dram.cc
@@ -1,8 +1,12 @@
#include "dram.h"
#include <catch2/catch_test_macros.hpp>
+#include <array>
TEST_CASE("Constructor initialize test 1", "[dram]")
{
Dram *d = new Dram(1, 4);
+ std::array<signed int, 4> expected = {0, 0, 0, 0};
+ std::array<signed int, 4> actual = d->view(0, 1)[0];
+ CHECK(expected == actual);
delete d;
}