MCPcopy Index your code
hub / github.com/HandmadeMath/HandmadeMath / TEST

Function TEST

test/categories/Subtraction.h:3–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "../HandmadeTest.h"
2
3TEST(Subtraction, Vec2)
4{
5 HMM_Vec2 v2_1 = HMM_V2(1.0f, 2.0f);
6 HMM_Vec2 v2_2 = HMM_V2(3.0f, 4.0f);
7
8 {
9 HMM_Vec2 result = HMM_SubV2(v2_1, v2_2);
10 EXPECT_FLOAT_EQ(result.X, -2.0f);
11 EXPECT_FLOAT_EQ(result.Y, -2.0f);
12 }
13#ifdef __cplusplus
14 {
15 HMM_Vec2 result = HMM_Sub(v2_1, v2_2);
16 EXPECT_FLOAT_EQ(result.X, -2.0f);
17 EXPECT_FLOAT_EQ(result.Y, -2.0f);
18 }
19 {
20 HMM_Vec2 result = v2_1 - v2_2;
21 EXPECT_FLOAT_EQ(result.X, -2.0f);
22 EXPECT_FLOAT_EQ(result.Y, -2.0f);
23 }
24
25 v2_1 -= v2_2;
26 EXPECT_FLOAT_EQ(v2_1.X, -2.0f);
27 EXPECT_FLOAT_EQ(v2_1.Y, -2.0f);
28#endif
29}
30
31TEST(Subtraction, Vec3)
32{

Callers

nothing calls this directly

Calls 15

HMM_V2Function · 0.85
HMM_SubV2Function · 0.85
HMM_SubFunction · 0.85
HMM_V3Function · 0.85
HMM_SubV3Function · 0.85
HMM_V4Function · 0.85
HMM_SubV4Function · 0.85
HMM_M2Function · 0.85
HMM_SubM2Function · 0.85
HMM_M3Function · 0.85
HMM_SubM3Function · 0.85
HMM_M4Function · 0.85

Tested by

no test coverage detected