feat: refactor rename test() to run()

This commit is contained in:
Michael Mandl 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 {
public:
virtual void test() override;
virtual void run() override;
};

View file

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

View file

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

View file

@ -4,5 +4,5 @@
class NullTest : public ChapterTest {
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);
}
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) << " ";

View file

@ -5,7 +5,7 @@
#include "ifswitch.h"
void IfswitchTest::test() {
void IfswitchTest::run() {
std::vector<uint32_t> vec = {1, 2, 3, 4};
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) {}
};
void InitListTest::test() {
void InitListTest::run() {
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 NullTest::test() {
void NullTest::run() {
if (std::is_same<decltype(NULL), decltype(0)>::value) {
std::cout << "NULL == 0" << std::endl;
}

View file

@ -3,5 +3,5 @@
class ChapterTest {
public:
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) {
std::cout << "\n" << name << std::endl;
test->test();
test->run();
}
std::cout << "\nExiting" << std::endl;