diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 14:53:01 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 14:54:13 -0500 |
| commit | a8e99f3a783069cf85b626c6cfb2fbe83ae4fd44 (patch) | |
| tree | 8322b0d20dd02660c3f26fcfd37c2cc4dcd33cda /tests/chunk_string | |
| parent | 463a0c01f96d86c9c91f02903bc1d194c5e55b15 (diff) | |
chore: new version of OCL and codebase cleanup.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'tests/chunk_string')
| -rw-r--r-- | tests/chunk_string/chunk_test.cc | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tests/chunk_string/chunk_test.cc b/tests/chunk_string/chunk_test.cc index 6b2d290..37f5cb1 100644 --- a/tests/chunk_string/chunk_test.cc +++ b/tests/chunk_string/chunk_test.cc @@ -6,26 +6,17 @@ */ #include <io/print.hpp> -#include <tests/gtest.hpp> +#include <gtest/gtest.h> #include <core/chunk_string.hpp> +const char* test_string = "HELLO, WORLD!\r\n"; +const auto iterations = 1024000; +const auto limit = 30; + TEST(ChunkTest, BasicChunkUsage) { - const char* test_string = "HELLO, WORLD!\r\n"; - const auto iterations = 1024000; - const auto limit = 30; - - auto start = std::chrono::high_resolution_clock::now(); - ocl::basic_chunk_string<char, iterations> optimized; - - for (unsigned i = 0; i < iterations; ++i) - { - optimized += test_string; - } - - auto end = std::chrono::high_resolution_clock::now(); - auto optimized_time = std::chrono::duration_cast<std::chrono::milliseconds>(end - start); - - EXPECT_TRUE(optimized_time.count() < 100U); + optimized += test_string; + + EXPECT_TRUE(optimized.str() == test_string); } |
