-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTriangleTest.cpp
More file actions
48 lines (35 loc) · 1.56 KB
/
TriangleTest.cpp
File metadata and controls
48 lines (35 loc) · 1.56 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
#include"hello.h"
#include"triangle.h"
//g++ -std=c++17 -Wall --pedantic-errors TriangleTest.cpp -o triangle
int main(){
//test 'hello.h'
std::cout << "Test Hello()" << '\n';
brahman::Hello();
std::cout << '\n';
//test 'area.h'
constexpr brahman::Triangle<double> tri(2.5, 4.2, 5.0);
constexpr brahman::Triangle<double> tri2(2.5, 4.2, 5.0);
std::cout << "Input data: " << tri.GetAB() << " " << tri.GetBC() << " " << tri.GetCA() << '\n' << '\n';
std::cout << "Test GetAB(), GetBC(), GetCA()" << '\n';
std::cout << "tri.GetAB(): " << tri.GetAB() << '\n';
std::cout << "tri.GetBC(): " << tri.GetBC() << '\n';
std::cout << "tri.GetCA(): " << tri.GetCA() << '\n' << '\n';
std::cout << "Test GetArea()" << '\n';
std::cout << "tri.GetArea(): " << tri.GetArea() << '\n' << '\n';
std::cout << "Test GetShape()" << '\n';
std::cout << "tri.GetShape(): " << tri.GetShape() << '\n' << '\n';
std::cout << "Test operator <<" << '\n';
std::cout << tri << tri2 << '\n' << '\n';
std::cout << "Test operator <" << '\n';
std::cout << (tri < tri2) << '\n' << '\n';
std::cout << "Test operator >" << '\n';
std::cout << (tri > tri2) << '\n' << '\n';
std::cout << "Test operator <=" << '\n';
std::cout << (tri <= tri2) << '\n' << '\n';
std::cout << "Test operator >=" << '\n';
std::cout << (tri >= tri2) << '\n' << '\n';
std::cout << "Test operator ==" << '\n';
std::cout << (tri == tri2) << '\n' << '\n';
std::cout << "Test operator !=" << '\n';
std::cout << (tri != tri2) << '\n' << '\n';
}