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

Function TEST

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

HMM_V2Function · 0.85
HMM_DivV2Function · 0.85
HMM_DivFunction · 0.85
HMM_DivV2FFunction · 0.85
HMM_V3Function · 0.85
HMM_DivV3Function · 0.85
HMM_DivV3FFunction · 0.85
HMM_V4Function · 0.85
HMM_DivV4Function · 0.85
HMM_DivV4FFunction · 0.85
HMM_M2Function · 0.85
HMM_DivM2FFunction · 0.85

Tested by

no test coverage detected