forked from EIE2-IAC-Labs/Lab3-FSM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (32 loc) · 777 Bytes
/
main.cpp
File metadata and controls
38 lines (32 loc) · 777 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
#include "gtest/gtest.h"
int add(int a, int b) { return a + b; }
class TestAdd : public ::testing::Test
{
void SetUp() override
{
// Runs before each test
}
void TearDown() override
{
// Runs after each test
}
};
// Don't worry about the syntax here, the TEST_F macro is very complicated.
// Just know that this is how you create a test case.
TEST_F(TestAdd, AddTest)
{
// This should pass, 2 + 4 = 6
EXPECT_EQ(add(2, 4), 6);
}
TEST_F(TestAdd, AddTest2)
{
// Create a test case here. Maybe fail this to see what happens?
EXPECT_EQ(add(3, 3), 6);
}
int main(int argc, char **argv)
{
// Standard Google Test main function
testing::InitGoogleTest(&argc, argv);
auto res = RUN_ALL_TESTS();
return res;
}