From 9bf9ffc6afcdc64ef10b872b1dff2072cab644c6 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Mon, 17 Feb 2025 14:32:56 +0300 Subject: [PATCH] remove catch --- meson.build | 1 - subprojects/catch2.wrap | 11 ------- tests/meson.build | 6 ---- tests/mt/mt.cpp | 31 ------------------ tests/patterns/ring_buffer.cpp | 60 ---------------------------------- 5 files changed, 109 deletions(-) delete mode 100644 subprojects/catch2.wrap delete mode 100644 tests/meson.build delete mode 100644 tests/mt/mt.cpp delete mode 100644 tests/patterns/ring_buffer.cpp diff --git a/meson.build b/meson.build index a166c21..73899c0 100755 --- a/meson.build +++ b/meson.build @@ -35,4 +35,3 @@ deps = [ subdir('src') subdir('bin') -subdir('tests') diff --git a/subprojects/catch2.wrap b/subprojects/catch2.wrap deleted file mode 100644 index f9bf436..0000000 --- a/subprojects/catch2.wrap +++ /dev/null @@ -1,11 +0,0 @@ -[wrap-file] -directory = Catch2-3.7.1 -source_url = https://github.com/catchorg/Catch2/archive/v3.7.1.tar.gz -source_filename = Catch2-3.7.1.tar.gz -source_hash = c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/catch2_3.7.1-1/Catch2-3.7.1.tar.gz -wrapdb_version = 3.7.1-1 - -[provide] -catch2 = catch2_dep -catch2-with-main = catch2_with_main_dep diff --git a/tests/meson.build b/tests/meson.build deleted file mode 100644 index ac2a1ca..0000000 --- a/tests/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -catch2_with_main_dep = dependency('catch2-with-main') -dep = [hack_dep, catch2_with_main_dep] - -test('patterns', executable('patterns', ['patterns/ring_buffer.cpp'], dependencies : dep)) -test('mt', executable('mt', ['mt/mt.cpp'], dependencies : dep)) - diff --git a/tests/mt/mt.cpp b/tests/mt/mt.cpp deleted file mode 100644 index 6a85921..0000000 --- a/tests/mt/mt.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "catch2/catch_test_macros.hpp" - -#include - -#include "hack/mt/algorithms/max.hpp" -#include "hack/mt/algorithms/sort.hpp" - -TEST_CASE("mt") -{ - SECTION("max") - { - int a = 4, b = 5; - int& c = a; - REQUIRE(hack::mt::algorithms::max(4, 5) == 5); - REQUIRE(hack::mt::algorithms::max(c, b) == 5); - } - - SECTION("sort") - { - std::vector v { 4, 4, 6, 1, 4, 3, 2 }; - std::vector vs { 1, 2, 3, 4, 4, 4, 6 }; - - std::forward_list l { 8, 7, 5, 9, 0, 1, 3, 2, 6, 4 }; - std::forward_list ls { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - - hack::mt::algorithms::sort(v); - hack::mt::algorithms::sort(l); - REQUIRE(v == vs); - REQUIRE(l == ls); - } -} diff --git a/tests/patterns/ring_buffer.cpp b/tests/patterns/ring_buffer.cpp deleted file mode 100644 index a210659..0000000 --- a/tests/patterns/ring_buffer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "catch2/catch_test_macros.hpp" - -#include "hack/patterns/ring_buffer.hpp" - -TEST_CASE("patterns") -{ - SECTION("ring buffer") - { - // single value - hack::patterns::ring_buffer rb1(10); - REQUIRE(rb1.empty() == true); - - for (int i = 1; i < 13; ++i) rb1.put(i); - REQUIRE(rb1.empty() == false); - REQUIRE(rb1.size() == 10); - - while(!rb1.empty()) REQUIRE(rb1.get().has_value() == true); - REQUIRE(rb1.empty() == true); - REQUIRE(rb1.size() == 0); - - rb1.put(123); - rb1.put(23); - rb1.put(3); - REQUIRE(rb1.get().value() == 123); - REQUIRE(rb1.empty() == false); - REQUIRE(rb1.size() == 2); - - REQUIRE(rb1.get().value() == 23); - REQUIRE(rb1.empty() == false); - REQUIRE(rb1.size() == 1); - - rb1.reset(); - REQUIRE(rb1.empty() == true); - REQUIRE(rb1.size() == 0); - REQUIRE(rb1.get().has_value() == false); - - // vector value - std::vector v { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - hack::patterns::ring_buffer rb2(10); - REQUIRE(rb2.empty() == true); - - rb2.put(v); - REQUIRE(rb2.get().value() == 1); - REQUIRE(rb2.get().value() == 2); - - v.emplace_back(17); - rb2.put(v); - REQUIRE(rb2.get().value() == 2); - REQUIRE(rb2.get().value() == 3); - REQUIRE(rb2.get().value() == 4); - REQUIRE(rb2.get().value() == 5); - REQUIRE(rb2.get().value() == 6); - REQUIRE(rb2.get().value() == 7); - REQUIRE(rb2.get().value() == 8); - REQUIRE(rb2.get().value() == 9); - REQUIRE(rb2.get().value() == 10); - REQUIRE(rb2.get().value() == 17); - } -} -