-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_suites.cpp
More file actions
82 lines (69 loc) · 2.08 KB
/
Copy pathtest_suites.cpp
File metadata and controls
82 lines (69 loc) · 2.08 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <gtest/gtest.h>
#include <vector>
#include <string>
#include <iostream>
//==============================================================================
// MathSuite - Basic mathematical operations
//==============================================================================
TEST(MathSuite, Addition)
{
std::cout << "Running MathSuite.Addition" << std::endl;
EXPECT_EQ(1 + 1, 2);
}
TEST(MathSuite, Subtraction)
{
std::cout << "Running MathSuite.Subtraction" << std::endl;
EXPECT_EQ(5 - 3, 2);
}
TEST(MathSuite, Multiplication)
{
std::cout << "Running MathSuite.Multiplication" << std::endl;
EXPECT_EQ(2 * 3, 6);
}
TEST(MathSuite, Division)
{
std::cout << "Running MathSuite.Division" << std::endl;
EXPECT_EQ(6 / 2, 3);
}
//==============================================================================
// StringSuite - String operations
//==============================================================================
TEST(StringSuite, Length)
{
std::cout << "Running StringSuite.Length" << std::endl;
EXPECT_EQ(std::string("hello").length(), 5);
}
TEST(StringSuite, Concatenation)
{
std::cout << "Running StringSuite.Concatenation" << std::endl;
EXPECT_EQ(std::string("hello") + " world", "hello world");
}
TEST(StringSuite, Comparison)
{
std::cout << "Running StringSuite.Comparison" << std::endl;
EXPECT_LT(std::string("abc"), "def");
}
//==============================================================================
// VectorSuite - Vector operations
//==============================================================================
TEST(VectorSuite, Size)
{
std::cout << "Running VectorSuite.Size" << std::endl;
std::vector<int> v = {1, 2, 3};
EXPECT_EQ(v.size(), 3);
}
TEST(VectorSuite, PushBack)
{
std::cout << "Running VectorSuite.PushBack" << std::endl;
std::vector<int> v;
v.push_back(42);
EXPECT_EQ(v.size(), 1);
EXPECT_EQ(v[0], 42);
}
TEST(VectorSuite, Clear)
{
std::cout << "Running VectorSuite.Clear" << std::endl;
std::vector<int> v = {1, 2, 3};
v.clear();
EXPECT_TRUE(v.empty());
}