-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (49 loc) · 685 Bytes
/
main.cpp
File metadata and controls
61 lines (49 loc) · 685 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "HaphaiTest.h"
#include "test.h"
int* correct_answer;
TEST(foo_2)
{
ASSERT_EQUAL(foo(2), correct_answer[0]);
}
TEST(foo_3)
{
ASSERT_EQUAL(foo(3), correct_answer[1]);
}
TEST(foo_4)
{
ASSERT_EQUAL(foo(4), correct_answer[2]);
}
TEST(foo_5)
{
ASSERT_EQUAL(foo(5), correct_answer[3]);
}
TEST(throw_test)
{
ASSERT_THROW(foo(5), std::logic_error);
}
TEST(wrong_throw)
{
ASSERT_THROW(foo(5), std::runtime_error);
}
TEST(manual_fail)
{
FAIL();
}
TEST(force_succeed)
{
SUCCEED();
FAIL();
}
SETUP()
{
correct_answer = new int[4];
for (int i = 2; i <= 5; ++i) correct_answer[i - 2] = correct_foo(i);
}
TEARDOWN()
{
delete[] correct_answer;
}
int main()
{
RUN();
}