aboutsummaryrefslogtreecommitdiff
path: root/lib/tst/mem.cc
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-03-05 14:38:54 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-03-05 14:38:54 +0200
commit787c1a6016dd2fdb51f20fcb5ca0ac5e461892d6 (patch)
tree7db9f5102adc3d50ca85a8175ce67465256b8908 /lib/tst/mem.cc
parentAdd TARGETBIN and TARGETLIB rules (diff)
downloadkernel-787c1a6016dd2fdb51f20fcb5ca0ac5e461892d6.tar.xz
Move all tests next to the code they're testing
Diffstat (limited to 'lib/tst/mem.cc')
-rw-r--r--lib/tst/mem.cc29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/tst/mem.cc b/lib/tst/mem.cc
deleted file mode 100644
index 1ad266c..0000000
--- a/lib/tst/mem.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <gtest/gtest.h>
-
-#define restrict __restrict__
-
-namespace libk {
-#include "../libk/stdlib/memcpy.c"
-#include "../libk/stdlib/memset.c"
-} // namespace libk
-
-TEST(mem, memset)
-{
- auto *buffer = new unsigned char[2048];
-
- libk::memset(buffer, 0xae, sizeof(buffer));
- for (unsigned i = 0; i < sizeof(buffer); ++i) EXPECT_EQ(buffer[i], 0xae);
-
- delete[] buffer;
-}
-
-TEST(mem, memcpy)
-{
- const unsigned char data[] = {0xde, 0xca, 0xfa, 0xde};
- auto *buffer = new unsigned char[sizeof(data)];
-
- memcpy(buffer, data, sizeof(data));
- for (unsigned i = 0; i < sizeof(data); ++i) EXPECT_EQ(buffer[i], data[i]);
-
- delete[] buffer;
-}