From 88742436a11b629cfec1394823ee9d35f16bbf4d Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sat, 21 Oct 2023 16:44:06 +0200 Subject: [PATCH] feat: refactor rename test() to run() --- chapters/chapter_02/include/constexp.h | 2 +- chapters/chapter_02/include/ifswitch.h | 2 +- chapters/chapter_02/include/initlist.h | 2 +- chapters/chapter_02/include/null.h | 2 +- chapters/chapter_02/src/constexp.cpp | 2 +- chapters/chapter_02/src/ifswitch.cpp | 2 +- chapters/chapter_02/src/initlist.cpp | 2 +- chapters/chapter_02/src/null.cpp | 2 +- chapters/interface/include/chapter_interface.h | 2 +- src/main.cpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chapters/chapter_02/include/constexp.h b/chapters/chapter_02/include/constexp.h index 1e9d6ef..fd9e992 100644 --- a/chapters/chapter_02/include/constexp.h +++ b/chapters/chapter_02/include/constexp.h @@ -4,5 +4,5 @@ class ConstExpTest : public ChapterTest { public: - virtual void test() override; + virtual void run() override; }; diff --git a/chapters/chapter_02/include/ifswitch.h b/chapters/chapter_02/include/ifswitch.h index dfd4a6d..140f89f 100644 --- a/chapters/chapter_02/include/ifswitch.h +++ b/chapters/chapter_02/include/ifswitch.h @@ -4,5 +4,5 @@ class IfswitchTest : public ChapterTest { public: - virtual void test() override; + virtual void run() override; }; diff --git a/chapters/chapter_02/include/initlist.h b/chapters/chapter_02/include/initlist.h index b92f891..22a474e 100644 --- a/chapters/chapter_02/include/initlist.h +++ b/chapters/chapter_02/include/initlist.h @@ -4,5 +4,5 @@ class InitListTest : public ChapterTest { public: - virtual void test() override; + virtual void run() override; }; diff --git a/chapters/chapter_02/include/null.h b/chapters/chapter_02/include/null.h index f72f834..f8add2e 100644 --- a/chapters/chapter_02/include/null.h +++ b/chapters/chapter_02/include/null.h @@ -4,5 +4,5 @@ class NullTest : public ChapterTest { public: - virtual void test() override; + virtual void run() override; }; diff --git a/chapters/chapter_02/src/constexp.cpp b/chapters/chapter_02/src/constexp.cpp index 3d3479a..879e33a 100644 --- a/chapters/chapter_02/src/constexp.cpp +++ b/chapters/chapter_02/src/constexp.cpp @@ -9,7 +9,7 @@ constexpr unsigned int fibonacci(const unsigned int n) { return fibonacci(n - 2) + fibonacci(n - 1); } -void ConstExpTest::test() { +void ConstExpTest::run() { std::cout << "Fibonacci(10): "; for (const unsigned int n : {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) { std::cout << fibonacci(n) << " "; diff --git a/chapters/chapter_02/src/ifswitch.cpp b/chapters/chapter_02/src/ifswitch.cpp index 54ce430..62d6f03 100644 --- a/chapters/chapter_02/src/ifswitch.cpp +++ b/chapters/chapter_02/src/ifswitch.cpp @@ -5,7 +5,7 @@ #include "ifswitch.h" -void IfswitchTest::test() { +void IfswitchTest::run() { std::vector vec = {1, 2, 3, 4}; if (auto it = std::find(vec.begin(), vec.end(), 23); it != vec.end()) { diff --git a/chapters/chapter_02/src/initlist.cpp b/chapters/chapter_02/src/initlist.cpp index 3eb17c8..97642a5 100644 --- a/chapters/chapter_02/src/initlist.cpp +++ b/chapters/chapter_02/src/initlist.cpp @@ -10,7 +10,7 @@ public: InitList(std::initializer_list list) : _list(list) {} }; -void InitListTest::test() { +void InitListTest::run() { InitList initList{1, 2, 3, 4, 5}; diff --git a/chapters/chapter_02/src/null.cpp b/chapters/chapter_02/src/null.cpp index dc71324..99fefd3 100644 --- a/chapters/chapter_02/src/null.cpp +++ b/chapters/chapter_02/src/null.cpp @@ -7,7 +7,7 @@ void call_test(char *) { std::cout << "call_test(char *) called" << std::endl; } void call_test(int) { std::cout << "call_test(int) called" << std::endl; } -void NullTest::test() { +void NullTest::run() { if (std::is_same::value) { std::cout << "NULL == 0" << std::endl; } diff --git a/chapters/interface/include/chapter_interface.h b/chapters/interface/include/chapter_interface.h index d45b9ad..c79c66a 100644 --- a/chapters/interface/include/chapter_interface.h +++ b/chapters/interface/include/chapter_interface.h @@ -3,5 +3,5 @@ class ChapterTest { public: virtual ~ChapterTest() = default; - virtual void test() = 0; + virtual void run() = 0; }; diff --git a/src/main.cpp b/src/main.cpp index 0d3f429..c8da422 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (auto &[name, test] : chapterTests) { std::cout << "\n" << name << std::endl; - test->test(); + test->run(); } std::cout << "\nExiting" << std::endl;