-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestVector3D.h
More file actions
158 lines (141 loc) · 4.99 KB
/
TestVector3D.h
File metadata and controls
158 lines (141 loc) · 4.99 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
TestVector3D: Defined functions for testing the vector3D class
@file vector3D.h
@author Adanna Obibuaku
@date 14/11/20
*/
#define TEST_X 1
#define TEST_Y 1
#define TEST_Z 1
#define SCALAR 3.5
#define TEST_NO_VECTOR 12
#ifndef VECT_HEADER
#define VECT_HEADER
#include "Vector3D.h"
#endif
/*
* <-------------------------------------------------------------------------------------------------->
*
* Testing Vector3D
*
* <-------------------------------------------------------------------------------------------------->
*/
// Our Test classes:
/*
* testComponetentX: To test whether the getX() method in the vector class returns the correct
* X componet
* Input:
* v (Vector3D): The vector your testing
* expected (float): Your expected x componets
* Output:
* (bool): denotes if the x returned from Vector3D is the same as expected
*/
bool testCompontentX(Vector3D v, float expected);
/*
* testComponetentY: To test whether the getY() method in the vector class returns the correct
* Y componet
* Input:
* v (Vector3D): The vector your testing
* expected (float): Your expected y componets
* Output:
* (bool): denotes if the y returned from Vector3D is the same as expected
*/
bool testCompontentY(Vector3D v, float expected);
/*
* testComponetentZ: To test whether the getZ() method in the vector class returns the correct
* Z componet
* Input:
* v (Vector3D): The vector your testing
* expected (float): Your expected x componets
* Output:
* (bool): denotes if the z returned from Vector3D is the same as expected
*/
bool testCompontentZ(Vector3D v, float expected);
/*
* testMagnitude: Testing the magnitude function in the vector class
* Input:
* v (Vector3D): The vector your testing
* expected (float): Your expected magnitude
* Output:
* (bool): denotes if the magnitude function provided by Vector3D is expected
*/
bool testMagnitude(Vector3D v, float expected);
/*
* testAddition: Testing the addition operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* v1 (Vector3D): The vector to be added
* expected (Vector3D): The expected Vector
* Output:
* (bool): denotes if the addition operator provided by Vector3D is expected
*/
bool testAddition(Vector3D v, Vector3D v1, Vector3D expected);
/*
* testSubtraction: Testing the subtraction operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* v1 (Vector3D): The vector to be subtracted
* expected (Vector3D): The expected Vector
* Output:
* (bool): denotes if the subtraction operator provided by Vector3D is expected
*/
bool testSubtraction(Vector3D v, Vector3D v1, Vector3D expected);
/*
* testMulitplyByScalar: Testing the muplication scalar operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* scalar (float): The scalar to be applied
* expected (Vector3D): The expected Vector
* Output:
* (bool): denotes if the muplication scalar operator provided by Vector3D is expected
*/
bool testMultiplyByScalar(Vector3D v, float scalar, Vector3D expected);
/*
* testDivideByScalar: Testing the division scalar operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* scalar (float): The scalar to be applied
* expected (Vector3D): The expected Vector
* Output:
* (bool): denotes if the division scalar operator provided by Vector3D is expected
*/
bool testDivideByScalar(Vector3D v, float scalar, Vector3D expected);
/*
* testScalarProduct: Testing the scalar product operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* v1 (Vector3D): The vector to apply with scalar product of v
* expected (float): The expected scalar product
* Output:
* (bool): denotes if the scalar product operator provided by Vector3D is expected
*/
bool testScalarProduct(Vector3D v, Vector3D v1, float expected);
/*
* testVectorProduct: Testing the vector product operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* v1 (Vector3D): The vector to apply with scalar product of v
* expected (Vector3D): The expected vector product
* Output:
* (bool): denotes if the vector product operator provided by Vector3D is expected
*/
bool testVectorProduct(Vector3D v, Vector3D v1, Vector3D expected);
/*
* testUnitVector: Testing the unit function in the vector class
* Input:
* v (Vector3D): The vector your testing
* expected (Vector3D): The expected unit vector
* Output:
* (bool): denotes if the unit vector provided by Vector3D is expected
*/
bool testUnitVector(Vector3D v, Vector3D expected);
/*
* testOrthogonal: Testing the vector product operator in the vector class
* Input:
* v (Vector3D): The vector your testing
* v1 (Vector3D): The vector to check if its perpendicular
* bool (Vector3D): The exppected boolean
* Output:
* (bool): denotes if the vector product operator provided by Vector3D is expected
*/
bool testOrthogonal(Vector3D v, Vector3D v1, bool expected);