-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestingdoc.cpp
More file actions
43 lines (35 loc) · 788 Bytes
/
Testingdoc.cpp
File metadata and controls
43 lines (35 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define DOCTEST_CONFIG_IMPLEMENT
#include "doctest.h"
#include <iostream>
int factorial(int number) { return number <= 1 ? number : factorial(number - 1) * number; }
class SomeClass
{
public:
SomeClass()
{
std::cout << "Hello";
}
};
TEST_CASE("testing the factorial function")
{
CHECK(factorial(1) == 1);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
}
TEST_SUITE("Testing")
{
TEST_CASE("testing the factorial function")
{
CHECK(factorial(1) == 1);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
}
TEST_CASE("Just A Check")
{
SomeClass* SC = new SomeClass();
CHECK(SC != nullptr);
MESSAGE(" SC not null ");
}
}