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

Function TEST

test/categories/VectorOps.h:3–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "../HandmadeTest.h"
2
3TEST(VectorOps, LengthSquared)
4{
5 HMM_Vec2 v2 = HMM_V2(1.0f, -2.0f);
6 HMM_Vec3 v3 = HMM_V3(1.0f, -2.0f, 3.0f);
7 HMM_Vec4 v4 = HMM_V4(1.0f, -2.0f, 3.0f, 1.0f);
8
9 EXPECT_FLOAT_EQ(HMM_LenSqrV2(v2), 5.0f);
10 EXPECT_FLOAT_EQ(HMM_LenSqrV3(v3), 14.0f);
11 EXPECT_FLOAT_EQ(HMM_LenSqrV4(v4), 15.0f);
12
13#ifdef __cplusplus
14 EXPECT_FLOAT_EQ(HMM_LenSqr(v2), 5.0f);
15 EXPECT_FLOAT_EQ(HMM_LenSqr(v3), 14.0f);
16 EXPECT_FLOAT_EQ(HMM_LenSqr(v4), 15.0f);
17#endif
18}
19
20TEST(VectorOps, Length)
21{

Callers

nothing calls this directly

Calls 15

HMM_V2Function · 0.85
HMM_V3Function · 0.85
HMM_V4Function · 0.85
HMM_LenSqrV2Function · 0.85
HMM_LenSqrV3Function · 0.85
HMM_LenSqrV4Function · 0.85
HMM_LenSqrFunction · 0.85
HMM_LenV2Function · 0.85
HMM_LenV3Function · 0.85
HMM_LenV4Function · 0.85
HMM_LenFunction · 0.85
HMM_NormV2Function · 0.85

Tested by

no test coverage detected