1
0

feat: refactor rename test() to run()

This commit is contained in:
mandlm 2023-10-21 16:44:06 +02:00
parent 89d1469088
commit 88742436a1
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
10 changed files with 10 additions and 10 deletions

View File

@ -4,5 +4,5 @@
class ConstExpTest : public ChapterTest { class ConstExpTest : public ChapterTest {
public: public:
virtual void test() override; virtual void run() override;
}; };

View File

@ -4,5 +4,5 @@
class IfswitchTest : public ChapterTest { class IfswitchTest : public ChapterTest {
public: public:
virtual void test() override; virtual void run() override;
}; };

View File

@ -4,5 +4,5 @@
class InitListTest : public ChapterTest { class InitListTest : public ChapterTest {
public: public:
virtual void test() override; virtual void run() override;
}; };

View File

@ -4,5 +4,5 @@
class NullTest : public ChapterTest { class NullTest : public ChapterTest {
public: public:
virtual void test() override; virtual void run() override;
}; };

View File

@ -9,7 +9,7 @@ constexpr unsigned int fibonacci(const unsigned int n) {
return fibonacci(n - 2) + fibonacci(n - 1); return fibonacci(n - 2) + fibonacci(n - 1);
} }
void ConstExpTest::test() { void ConstExpTest::run() {
std::cout << "Fibonacci(10): "; std::cout << "Fibonacci(10): ";
for (const unsigned int n : {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) { for (const unsigned int n : {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) {
std::cout << fibonacci(n) << " "; std::cout << fibonacci(n) << " ";

View File

@ -5,7 +5,7 @@
#include "ifswitch.h" #include "ifswitch.h"
void IfswitchTest::test() { void IfswitchTest::run() {
std::vector<uint32_t> vec = {1, 2, 3, 4}; std::vector<uint32_t> vec = {1, 2, 3, 4};
if (auto it = std::find(vec.begin(), vec.end(), 23); it != vec.end()) { if (auto it = std::find(vec.begin(), vec.end(), 23); it != vec.end()) {

View File

@ -10,7 +10,7 @@ public:
InitList(std::initializer_list<unsigned int> list) : _list(list) {} InitList(std::initializer_list<unsigned int> list) : _list(list) {}
}; };
void InitListTest::test() { void InitListTest::run() {
InitList initList{1, 2, 3, 4, 5}; InitList initList{1, 2, 3, 4, 5};

View File

@ -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 call_test(int) { std::cout << "call_test(int) called" << std::endl; }
void NullTest::test() { void NullTest::run() {
if (std::is_same<decltype(NULL), decltype(0)>::value) { if (std::is_same<decltype(NULL), decltype(0)>::value) {
std::cout << "NULL == 0" << std::endl; std::cout << "NULL == 0" << std::endl;
} }

View File

@ -3,5 +3,5 @@
class ChapterTest { class ChapterTest {
public: public:
virtual ~ChapterTest() = default; virtual ~ChapterTest() = default;
virtual void test() = 0; virtual void run() = 0;
}; };

View File

@ -25,7 +25,7 @@ int main(int argc, char **argv) {
for (auto &[name, test] : chapterTests) { for (auto &[name, test] : chapterTests) {
std::cout << "\n" << name << std::endl; std::cout << "\n" << name << std::endl;
test->test(); test->run();
} }
std::cout << "\nExiting" << std::endl; std::cout << "\nExiting" << std::endl;