Repository: HandmadeMath/HandmadeMath (c)

Issue:
Doesn't build in C (non-C++) mode
It currently doesn't build in C mode, because `NLerp` uses `HMM_Normalize()` instead of `HMM_NormalizeQuaternion()`.

I also doubt that a compiler enforcing real C99 mode would be very happy about your usage of inline in the implementation.  
Having function declarations like `extern float HMM_CosF(float Angle);` and then the implementation as `inline float HMM_CosF(float Angle)` looks very wrong.  
And C99 and newer has that weird thing where functions declared inline in the header must be implemented twice: inline in the header *and* not-inline in the implementation - which is pretty much the opposite of what you're doing there (to get classic/C++ inline behavior one would just supply a `static inline` implementation in the header).


Discussion:
Ack. This is what we get for only running our tests in C++ mode. I'll dig into these issues and see what I can do.
Great, thank you!

Regarding the C99 thing, it may make sense to test with -std=c99 and 
using two 2 .c files, so only one of them has #define 
HANDMADE_MATH_IMPLEMENTATION and the other can't "see" the function 
implementations


Patch:
diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,4 @@
 *.out
 *.app
 hmm_test
+hmm_test*
diff --git a/.gitmodules b/.gitmodules
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "externals/googletest"]
-	path = externals/googletest
-	url = https://github.com/google/googletest.git
diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,4 +5,6 @@ compiler:
 install:
   - cd test
   - make
-script: ./hmm_test
+script:
+  - ./hmm_test_c
+  - ./hmm_test_cpp
diff --git a/HandmadeMath.h b/HandmadeMath.h
--- a/HandmadeMath.h
+++ b/HandmadeMath.h
@@ -173,6 +173,8 @@
           (*) Resolved compiler warnings on gcc and g++
      1.1.2
           (*) Fixed invalid HMMDEF's in the function definitions
+     1.1.3
+          (*) Fixed compile error in C mode
           
   LICENSE
   
@@ -1692,7 +1694,7 @@ HMM_NLerp(hmm_quaternion Left, float Time, hmm_quaternion Right)
     Result.Z = HMM_Lerp(Left.Z, Time, Right.Z);
     Result.W = HMM_Lerp(Left.W, Time, Right.W);
 
-    Result = HMM_Normalize(Result);
+    Result = HMM_NormalizeQuaternion(Result);
 
     return(Result);
 }
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ _This library is free and will stay free, but if you would like to support devel
 
 Version         | Changes        | 
 ----------------|----------------|
+**1.1.3** | Fixed compile error in C mode
 **1.1.2** | Fixed invalid HMMDEF's in the function definitions
 **1.1.1** | Resolved compiler warnings on gcc and g++
 **1.1**   | Quaternions! |
@@ -35,7 +36,7 @@ _This library is free and will stay free, but if you would like to support devel
 
 **What's the license?**
 
-This library is in the public domain. You can do whatever you want with them.
+This library is in the public domain. You can do whatever you want with it.
 
 **Where can I contact you to ask questions?**
 
diff --git a/externals/googletest b/externals/googletest
deleted file mode 160000
--- a/externals/googletest
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ed9d1e1ff92ce199de5ca2667a667cd0a368482a


Test patch:
diff --git a/test/HandmadeMath.c b/test/HandmadeMath.c
new file mode 100644
--- /dev/null
+++ b/test/HandmadeMath.c
@@ -0,0 +1,4 @@
+
+#define HANDMADE_MATH_IMPLEMENTATION
+#define HANDMADE_MATH_NO_INLINE
+#include "../HandmadeMath.h"
diff --git a/test/HandmadeTest.h b/test/HandmadeTest.h
new file mode 100644
--- /dev/null
+++ b/test/HandmadeTest.h
@@ -0,0 +1,80 @@
+#ifndef HANDMADETEST_H
+#define HANDMADETEST_H
+
+#include <float.h>
+#include <stdio.h>
+
+int hmt_count_tests = 0;
+int hmt_count_failedtests = 0;
+int hmt_count_failures = 0;
+
+#define RESET "\033[0m"
+#define RED   "\033[31m"
+#define GREEN "\033[32m"
+
+#define CATEGORY_BEGIN(name) { \
+    int count_categorytests = 0; \
+    int count_categoryfailedtests = 0; \
+    int count_categoryfailures = 0; \
+    printf("\n" #name ":\n");
+#define CATEGORY_END(name) \
+    hmt_count_tests += count_categorytests; \
+    hmt_count_failedtests += count_categoryfailedtests; \
+    hmt_count_failures += count_categoryfailures; \
+    printf("%d/%d tests passed, %d failures\n", count_categorytests - count_categoryfailedtests, count_categorytests, count_categoryfailures); \
+}
+
+#define TEST_BEGIN(name) { \
+    int count_testfailures = 0; \
+    count_categorytests++; \
+    printf("    " #name ":");
+#define TEST_END() \
+    count_categoryfailures += count_testfailures; \
+    if (count_testfailures > 0) { \
+        count_categoryfailedtests++; \
+        printf("\n"); \
+    } else { \
+        printf(GREEN " [PASS]\n" RESET); \
+    } \
+}
+
+#define CASE_FAIL() \
+    count_testfailures++; \
+    printf("\n      - " RED "[FAIL] (%d) " RESET, __LINE__)
+
+/*
+ * Asserts and expects
+ */
+#define EXPECT_FLOAT_EQ(_actual, _expected) do { \
+    float actual = (_actual); \
+    float diff = actual - (_expected); \
+    if (diff < -FLT_EPSILON || FLT_EPSILON < diff) { \
+        CASE_FAIL(); \
+        printf("Expected %f, got %f", (_expected), actual); \
+    } \
+} while (0)
+
+#define EXPECT_NEAR(_actual, _expected, _epsilon) do { \
+    float actual = (_actual); \
+    float diff = actual - (_expected); \
+    if (diff < -(_epsilon) || (_epsilon) < diff) { \
+        CASE_FAIL(); \
+        printf("Expected %f, got %f", (_expected), actual); \
+    } \
+} while (0)
+
+#define EXPECT_LT(_actual, _expected) do { \
+    if ((_actual) >= (_expected)) { \
+        CASE_FAIL(); \
+        printf("Expected %f to be less than %f", (_actual), (_expected)); \
+    } \
+} while (0)
+
+#define EXPECT_GT(_actual, _expected) do { \
+    if ((_actual) <= (_expected)) { \
+        CASE_FAIL(); \
+        printf("Expected %f to be greater than %f", (_actual), (_expected)); \
+    } \
+} while (0)
+
+#endif
diff --git a/test/Makefile b/test/Makefile
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,81 +1,17 @@
-# A sample Makefile for building Google Test and using it in user
-# tests.  Please tweak it to suit your environment and project.  You
-# may want to move it to your project's root directory.
-#
-# SYNOPSIS:
-#
-#   make [all]  - makes everything.
-#   make TARGET - makes the given target.
-#   make clean  - removes all files generated by make.
+ROOT_DIR = ..
 
-# Please tweak the following variable definitions as needed by your
-# project, except GTEST_HEADERS, which you can use in your own targets
-# but shouldn't modify.
-
-# Points to the root of Google Test, relative to where this file is.
-# Remember to tweak this if you move this file.
-GTEST_DIR = ../externals/googletest/googletest
-
-# Where to find user code.
-USER_DIR = ..
-
-# Flags passed to the preprocessor.
-# Set Google Test's header directory as a system directory, such that
-# the compiler doesn't generate warnings in Google Test headers.
-CPPFLAGS += -isystem $(GTEST_DIR)/include
-
-# Flags passed to the C++ compiler.
 CXXFLAGS += -g -Wall -Wextra -pthread -Wno-missing-braces -Wno-missing-field-initializers
 
-# All tests produced by this Makefile.  Remember to add new tests you
-# created to the list.
-TESTS = hmm_test
-
-# All Google Test headers.  Usually you shouldn't change this
-# definition.
-GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
-                $(GTEST_DIR)/include/gtest/internal/*.h
-
-# House-keeping build targets.
-
-all : $(TESTS)
-
-clean :
-	rm -f $(TESTS) gtest.a gtest_main.a *.o
-
-# Builds gtest.a and gtest_main.a.
-
-# Usually you shouldn't tweak such internal variables, indicated by a
-# trailing _.
-GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
-
-# For simplicity and to avoid depending on Google Test's
-# implementation details, the dependencies specified below are
-# conservative and not optimized.  This is fine as Google Test
-# compiles fast and for ordinary users its source rarely changes.
-gtest-all.o : $(GTEST_SRCS_)
-	$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
-            $(GTEST_DIR)/src/gtest-all.cc
-
-gtest_main.o : $(GTEST_SRCS_)
-	$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
-            $(GTEST_DIR)/src/gtest_main.cc
-
-gtest.a : gtest-all.o
-	$(AR) $(ARFLAGS) $@ $^
-
-gtest_main.a : gtest-all.o gtest_main.o
-	$(AR) $(ARFLAGS) $@ $^
+all: c cpp
 
-# Builds a sample test.  A test should link with either gtest.a or
-# gtest_main.a, depending on whether it defines its own main()
-# function.
+clean:
+	rm -f hmm_test_c hmm_test_cpp *.o
 
-HandmadeMath.o : $(USER_DIR)/test/HandmadeMath.cpp $(USER_DIR)/HandmadeMath.h $(GTEST_HEADERS)
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/HandmadeMath.cpp
+c: $(ROOT_DIR)/test/HandmadeMath.c test_impl
+	$(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 -c $(ROOT_DIR)/test/HandmadeMath.c $(ROOT_DIR)/test/hmm_test.c -lm
+	$(CC) -ohmm_test_c HandmadeMath.o hmm_test.o -lm
 
-hmm_test.o : $(USER_DIR)/test/hmm_test.cpp $(GTEST_HEADERS)
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/hmm_test.cpp
+cpp: $(ROOT_DIR)/test/HandmadeMath.cpp test_impl
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp $(ROOT_DIR)/test/HandmadeMath.cpp $(ROOT_DIR)/test/hmm_test.cpp
 
-hmm_test : HandmadeMath.o hmm_test.o gtest_main.a
-	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
+test_impl: $(ROOT_DIR)/test/hmm_test.cpp $(ROOT_DIR)/test/hmm_test.c
diff --git a/test/hmm_test.c b/test/hmm_test.c
new file mode 100644
--- /dev/null
+++ b/test/hmm_test.c
@@ -0,0 +1,1945 @@
+#include <float.h>
+
+#include "HandmadeTest.h"
+#include "../HandmadeMath.h"
+
+int run_tests();
+
+int main()
+{
+    run_tests();
+
+    if (hmt_count_failedtests > 0) {
+        printf(RED);
+    } else {
+        printf(GREEN);
+    }
+    printf("\n%d/%d tests passed overall, %d failures\n" RESET, hmt_count_tests - hmt_count_failedtests, hmt_count_tests, hmt_count_failures);
+
+    printf("\n");
+
+    return (hmt_count_failedtests > 0);
+}
+
+int run_tests()
+{
+    CATEGORY_BEGIN(ScalarMath)
+    {
+        TEST_BEGIN(Trigonometry)
+        {
+            // We have to be a little looser with our equality constraint
+            // because of floating-point precision issues.
+            const float trigAbsError = 0.0001f;
+
+            EXPECT_NEAR(HMM_SinF(0.0f), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_SinF(HMM_PI32 / 2), 1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_SinF(HMM_PI32), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_SinF(3 * HMM_PI32 / 2), -1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_SinF(-HMM_PI32 / 2), -1.0f, trigAbsError);
+
+            EXPECT_NEAR(HMM_CosF(0.0f), 1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_CosF(HMM_PI32 / 2), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_CosF(HMM_PI32), -1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_CosF(3 * HMM_PI32 / 2), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_CosF(-HMM_PI32), -1.0f, trigAbsError);
+
+            EXPECT_NEAR(HMM_TanF(0.0f), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_TanF(HMM_PI32 / 4), 1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_TanF(3 * HMM_PI32 / 4), -1.0f, trigAbsError);
+            EXPECT_NEAR(HMM_TanF(HMM_PI32), 0.0f, trigAbsError);
+            EXPECT_NEAR(HMM_TanF(-HMM_PI32 / 4), -1.0f, trigAbsError);
+
+            // This isn't the most rigorous because we're really just sanity-
+            // checking that things work by default.
+        }
+        TEST_END()
+
+        TEST_BEGIN(ToRadians)
+        {
+            EXPECT_FLOAT_EQ(HMM_ToRadians(0.0f), 0.0f);
+            EXPECT_FLOAT_EQ(HMM_ToRadians(180.0f), HMM_PI32);
+            EXPECT_FLOAT_EQ(HMM_ToRadians(-180.0f), -HMM_PI32);
+        }
+        TEST_END()
+
+        TEST_BEGIN(SquareRoot)
+        {
+            EXPECT_FLOAT_EQ(HMM_SquareRootF(16.0f), 4.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(RSquareRootF)
+        {
+            EXPECT_FLOAT_EQ(HMM_RSquareRootF(10.0f), 0.31616211f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Power)
+        {
+            EXPECT_FLOAT_EQ(HMM_Power(2.0f, 0), 1.0f);
+            EXPECT_FLOAT_EQ(HMM_Power(2.0f, 4), 16.0f);       
+            EXPECT_FLOAT_EQ(HMM_Power(2.0f, -2), 0.25f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(PowerF)
+        {
+            EXPECT_FLOAT_EQ(HMM_PowerF(2.0f, 0), 1.0f);
+            EXPECT_NEAR(HMM_PowerF(2.0f, 4.1), 17.148376f, 0.0001f);
+            EXPECT_NEAR(HMM_PowerF(2.0f, -2.5), 0.176777f, 0.0001f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Lerp)
+        {
+            EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 0.0f, 2.0f), -2.0f);        
+            EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 0.5f, 2.0f), 0.0f);        
+            EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 1.0f, 2.0f), 2.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Clamp)
+        {
+            EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, 0.0f, 2.0f), 0.0f);        
+            EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, -3.0f, 2.0f), -2.0f);        
+            EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, 3.0f, 2.0f), 2.0f);
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Initialization)
+    {
+        TEST_BEGIN(Vectors)
+        {
+            //
+            // Test vec2
+            // 
+            hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
+            hmm_vec2 v2i = HMM_Vec2(1, 2);
+
+            EXPECT_FLOAT_EQ(v2.X, 1.0f);
+            EXPECT_FLOAT_EQ(v2.Y, 2.0f);
+
+            EXPECT_FLOAT_EQ(v2i.X, 1.0f);
+            EXPECT_FLOAT_EQ(v2i.Y, 2.0f);
+
+            //
+            // Test vec3
+            //
+            hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v3i = HMM_Vec3i(1, 2, 3);
+
+            EXPECT_FLOAT_EQ(v3.X, 1.0f);
+            EXPECT_FLOAT_EQ(v3.Y, 2.0f);
+            EXPECT_FLOAT_EQ(v3.Z, 3.0f);
+
+            EXPECT_FLOAT_EQ(v3i.X, 1.0f);
+            EXPECT_FLOAT_EQ(v3i.Y, 2.0f);
+            EXPECT_FLOAT_EQ(v3i.Z, 3.0f);
+
+            //
+            // Test vec4
+            //
+            hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_vec4 v4i = HMM_Vec4i(1, 2, 3, 4);
+            hmm_vec4 v4v = HMM_Vec4v(v3, 4.0f);
+
+            EXPECT_FLOAT_EQ(v4.X, 1.0f);
+            EXPECT_FLOAT_EQ(v4.Y, 2.0f);
+            EXPECT_FLOAT_EQ(v4.Z, 3.0f);
+            EXPECT_FLOAT_EQ(v4.W, 4.0f);
+
+            EXPECT_FLOAT_EQ(v4i.X, 1.0f);
+            EXPECT_FLOAT_EQ(v4i.Y, 2.0f);
+            EXPECT_FLOAT_EQ(v4i.Z, 3.0f);
+            EXPECT_FLOAT_EQ(v4i.W, 4.0f);
+
+            EXPECT_FLOAT_EQ(v4v.X, 1.0f);
+            EXPECT_FLOAT_EQ(v4v.Y, 2.0f);
+            EXPECT_FLOAT_EQ(v4v.Z, 3.0f);
+            EXPECT_FLOAT_EQ(v4v.W, 4.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(MatrixEmpty)
+        {
+            hmm_mat4 m4 = HMM_Mat4();
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    EXPECT_FLOAT_EQ(m4.Elements[Column][Row], 0.0f);
+                }
+            }
+        }
+        TEST_END()
+
+        TEST_BEGIN(MatrixDiagonal)
+        {
+            hmm_mat4 m4d = HMM_Mat4d(1.0f);
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    if (Column == Row) {
+                        EXPECT_FLOAT_EQ(m4d.Elements[Column][Row], 1.0f);
+                    } else {
+                        EXPECT_FLOAT_EQ(m4d.Elements[Column][Row], 0.0f);
+                    }
+                }
+            }
+        }
+        TEST_END()
+
+        TEST_BEGIN(Quaternion)
+        {
+            hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+
+            EXPECT_FLOAT_EQ(q.X, 1.0f);
+            EXPECT_FLOAT_EQ(q.Y, 2.0f);
+            EXPECT_FLOAT_EQ(q.Z, 3.0f);
+            EXPECT_FLOAT_EQ(q.W, 4.0f);
+
+            EXPECT_FLOAT_EQ(q.Elements[0], 1.0f);
+            EXPECT_FLOAT_EQ(q.Elements[1], 2.0f);
+            EXPECT_FLOAT_EQ(q.Elements[2], 3.0f);
+            EXPECT_FLOAT_EQ(q.Elements[3], 4.0f);
+
+            hmm_vec4 v = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion qv = HMM_QuaternionV4(v);
+
+            EXPECT_FLOAT_EQ(qv.X, 1.0f);
+            EXPECT_FLOAT_EQ(qv.Y, 2.0f);
+            EXPECT_FLOAT_EQ(qv.Z, 3.0f);
+            EXPECT_FLOAT_EQ(qv.W, 4.0f);
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(VectorOps)
+    {
+        TEST_BEGIN(LengthSquared)
+        {
+            hmm_vec2 v2 = HMM_Vec2(1.0f, -2.0f);
+            hmm_vec3 v3 = HMM_Vec3(1.0f, -2.0f, 3.0f); 
+            hmm_vec4 v4 = HMM_Vec4(1.0f, -2.0f, 3.0f, 1.0f);
+
+            EXPECT_FLOAT_EQ(HMM_LengthSquaredVec2(v2), 5.0f);
+            EXPECT_FLOAT_EQ(HMM_LengthSquaredVec3(v3), 14.0f);
+            EXPECT_FLOAT_EQ(HMM_LengthSquaredVec4(v4), 15.0f);
+
+#ifdef HANDMADE_MATH_CPP_MODE
+            EXPECT_FLOAT_EQ(HMM_LengthSquared(v2), 5.0f);
+            EXPECT_FLOAT_EQ(HMM_LengthSquared(v3), 14.0f);
+            EXPECT_FLOAT_EQ(HMM_LengthSquared(v4), 15.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Length)
+        {
+            hmm_vec2 v2 = HMM_Vec2(1.0f, -9.0f);
+            hmm_vec3 v3 = HMM_Vec3(2.0f, -3.0f, 6.0f);
+            hmm_vec4 v4 = HMM_Vec4(2.0f, -3.0f, 6.0f, 12.0f);
+
+            EXPECT_FLOAT_EQ(HMM_LengthVec2(v2), 9.0553856f);
+            EXPECT_FLOAT_EQ(HMM_LengthVec3(v3), 7.0f);
+            EXPECT_FLOAT_EQ(HMM_LengthVec4(v4), 13.892444f);
+
+#ifdef HANDMADE_MATH_CPP_MODE
+            EXPECT_FLOAT_EQ(HMM_Length(v2), 9.0553856f);
+            EXPECT_FLOAT_EQ(HMM_Length(v3), 7.0f);
+            EXPECT_FLOAT_EQ(HMM_Length(v4), 13.892444f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Normalize)
+        {
+            hmm_vec2 v2 = HMM_Vec2(1.0f, -2.0f);
+            hmm_vec3 v3 = HMM_Vec3(1.0f, -2.0f, 3.0f); 
+            hmm_vec4 v4 = HMM_Vec4(1.0f, -2.0f, 3.0f, -1.0f);
+
+            {
+                hmm_vec2 result = HMM_NormalizeVec2(v2);
+                EXPECT_FLOAT_EQ(HMM_LengthVec2(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+            }
+            {
+                hmm_vec3 result = HMM_NormalizeVec3(v3);
+                EXPECT_FLOAT_EQ(HMM_LengthVec3(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+                EXPECT_GT(result.Z, 0.0f);
+            }
+            {
+                hmm_vec4 result = HMM_NormalizeVec4(v4);
+                EXPECT_FLOAT_EQ(HMM_LengthVec4(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+                EXPECT_GT(result.Z, 0.0f);
+                EXPECT_LT(result.W, 0.0f);
+            }
+
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Normalize(v2);
+                EXPECT_FLOAT_EQ(HMM_LengthVec2(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+            }
+            {
+                hmm_vec3 result = HMM_Normalize(v3);
+                EXPECT_FLOAT_EQ(HMM_LengthVec3(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+                EXPECT_GT(result.Z, 0.0f);
+            }
+            {
+                hmm_vec4 result = HMM_Normalize(v4);
+                EXPECT_FLOAT_EQ(HMM_LengthVec4(result), 1.0f);
+                EXPECT_GT(result.X, 0.0f);
+                EXPECT_LT(result.Y, 0.0f);
+                EXPECT_GT(result.Z, 0.0f);
+                EXPECT_LT(result.W, 0.0f);
+            }
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Cross)
+        {
+            hmm_vec3 v1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
+
+            hmm_vec3 result = HMM_Cross(v1, v2);
+
+            EXPECT_FLOAT_EQ(result.X, -3.0f);
+            EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            EXPECT_FLOAT_EQ(result.Z, -3.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(DotVec2)
+        {
+            hmm_vec2 v1 = HMM_Vec2(1.0f, 2.0f);
+            hmm_vec2 v2 = HMM_Vec2(3.0f, 4.0f);
+
+            EXPECT_FLOAT_EQ(HMM_DotVec2(v1, v2), 11.0f);
+#ifdef HANDMADE_MATH_CPP_MODE
+            EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 11.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(DotVec3)
+        {
+            hmm_vec3 v1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
+
+            EXPECT_FLOAT_EQ(HMM_DotVec3(v1, v2), 32.0f);
+#ifdef HANDMADE_MATH_CPP_MODE
+            EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 32.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(DotVec4)
+        {
+            hmm_vec4 v1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_vec4 v2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
+
+            EXPECT_FLOAT_EQ(HMM_DotVec4(v1, v2), 70.0f);
+#ifdef HANDMADE_MATH_CPP_MODE
+            EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 70.0f);
+#endif
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(MatrixOps)
+    {
+        TEST_BEGIN(Transpose)
+        {
+            hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
+
+            // Fill the matrix
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the matrix
+            hmm_mat4 result = HMM_Transpose(m4);
+            EXPECT_FLOAT_EQ(result.Elements[0][0], 1.0f);
+            EXPECT_FLOAT_EQ(result.Elements[0][1], 5.0f);
+            EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
+            EXPECT_FLOAT_EQ(result.Elements[0][3], 13.0f);
+            EXPECT_FLOAT_EQ(result.Elements[1][0], 2.0f);
+            EXPECT_FLOAT_EQ(result.Elements[1][1], 6.0f);
+            EXPECT_FLOAT_EQ(result.Elements[1][2], 10.0f);
+            EXPECT_FLOAT_EQ(result.Elements[1][3], 14.0f);
+            EXPECT_FLOAT_EQ(result.Elements[2][0], 3.0f);
+            EXPECT_FLOAT_EQ(result.Elements[2][1], 7.0f);
+            EXPECT_FLOAT_EQ(result.Elements[2][2], 11.0f);
+            EXPECT_FLOAT_EQ(result.Elements[2][3], 15.0f);
+            EXPECT_FLOAT_EQ(result.Elements[3][0], 4.0f);
+            EXPECT_FLOAT_EQ(result.Elements[3][1], 8.0f);
+            EXPECT_FLOAT_EQ(result.Elements[3][2], 12.0f);
+            EXPECT_FLOAT_EQ(result.Elements[3][3], 16.0f);
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(QuaternionOps)
+    {
+        TEST_BEGIN(Inverse)
+        {
+            hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion inverse = HMM_InverseQuaternion(q1);
+
+            hmm_quaternion result = HMM_MultiplyQuaternion(q1, inverse);
+
+            EXPECT_FLOAT_EQ(result.X, 0.0f);
+            EXPECT_FLOAT_EQ(result.Y, 0.0f);
+            EXPECT_FLOAT_EQ(result.Z, 0.0f);
+            EXPECT_FLOAT_EQ(result.W, 1.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Dot)
+        {
+            hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                float result = HMM_DotQuaternion(q1, q2);
+                EXPECT_FLOAT_EQ(result, 70.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                float result = HMM_Dot(q1, q2);
+                EXPECT_FLOAT_EQ(result, 70.0f);
+            }
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Normalize)
+        {
+            hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+
+            {
+                hmm_quaternion result = HMM_NormalizeQuaternion(q);
+                EXPECT_FLOAT_EQ(result.X, 0.1825741858f);
+                EXPECT_FLOAT_EQ(result.Y, 0.3651483717f);
+                EXPECT_FLOAT_EQ(result.Z, 0.5477225575f);
+                EXPECT_FLOAT_EQ(result.W, 0.7302967433f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Normalize(q);
+                EXPECT_FLOAT_EQ(result.X, 0.1825741858f);
+                EXPECT_FLOAT_EQ(result.Y, 0.3651483717f);
+                EXPECT_FLOAT_EQ(result.Z, 0.5477225575f);
+                EXPECT_FLOAT_EQ(result.W, 0.7302967433f);
+            }
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(NLerp)
+        {
+            hmm_quaternion from = HMM_Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
+            hmm_quaternion to = HMM_Quaternion(0.5f, 0.5f, -0.5f, 0.5f);
+
+            hmm_quaternion result = HMM_NLerp(from, 0.5f, to);
+            EXPECT_FLOAT_EQ(result.X, 0.28867513f);
+            EXPECT_FLOAT_EQ(result.Y, 0.28867513f);
+            EXPECT_FLOAT_EQ(result.Z, -0.28867513f);
+            EXPECT_FLOAT_EQ(result.W, 0.86602540f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Slerp)
+        {
+            hmm_quaternion from = HMM_Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
+            hmm_quaternion to = HMM_Quaternion(0.5f, 0.5f, -0.5f, 0.5f);
+
+            hmm_quaternion result = HMM_Slerp(from, 0.5f, to);
+            EXPECT_FLOAT_EQ(result.X, 0.28867513f);
+            EXPECT_FLOAT_EQ(result.Y, 0.28867513f);
+            EXPECT_FLOAT_EQ(result.Z, -0.28867513f);
+            EXPECT_FLOAT_EQ(result.W, 0.86602540f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(ToMat4)
+        {
+            const float abs_error = 0.0001f;
+
+            hmm_quaternion rot = HMM_Quaternion(0.707107f, 0.0f, 0.0f, 0.707107f);
+
+            hmm_mat4 result = HMM_QuaternionToMat4(rot);
+
+            EXPECT_NEAR(result.Elements[0][0], 1.0f, abs_error);
+            EXPECT_NEAR(result.Elements[0][1], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[0][2], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[0][3], 0.0f, abs_error);
+
+            EXPECT_NEAR(result.Elements[1][0], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[1][1], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[1][2], 1.0f, abs_error);
+            EXPECT_NEAR(result.Elements[1][3], 0.0f, abs_error);
+
+            EXPECT_NEAR(result.Elements[2][0], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[2][1], -1.0f, abs_error);
+            EXPECT_NEAR(result.Elements[2][2], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[2][3], 0.0f, abs_error);
+
+            EXPECT_NEAR(result.Elements[3][0], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[3][1], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[3][2], 0.0f, abs_error);
+            EXPECT_NEAR(result.Elements[3][3], 1.0f, abs_error);
+        }
+        TEST_END()
+
+        TEST_BEGIN(FromAxisAngle)
+        {
+            hmm_vec3 axis = HMM_Vec3(1.0f, 0.0f, 0.0f);
+            float angle = HMM_PI32 / 2.0f;
+
+            hmm_quaternion result = HMM_QuaternionFromAxisAngle(axis, angle);
+            EXPECT_NEAR(result.X, 0.707107f, FLT_EPSILON * 2);
+            EXPECT_FLOAT_EQ(result.Y, 0.0f);
+            EXPECT_FLOAT_EQ(result.Z, 0.0f);
+            EXPECT_NEAR(result.W, 0.707107f, FLT_EPSILON * 2);
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Addition)
+    {
+        TEST_BEGIN(Vec2)
+        {
+            hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
+            hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
+
+            {
+                hmm_vec2 result = HMM_AddVec2(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Add(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+            {
+                hmm_vec2 result = v2_1 + v2_2;
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+
+            v2_1 += v2_2;
+            EXPECT_FLOAT_EQ(v2_1.X, 4.0f);
+            EXPECT_FLOAT_EQ(v2_1.Y, 6.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3)
+        {
+            hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
+
+            {
+                hmm_vec3 result = HMM_AddVec3(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 7.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);    
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Add(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 7.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+            {
+                hmm_vec3 result = v3_1 + v3_2;
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 7.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+
+            v3_1 += v3_2;
+            EXPECT_FLOAT_EQ(v3_1.X, 5.0f);
+            EXPECT_FLOAT_EQ(v3_1.Y, 7.0f);
+            EXPECT_FLOAT_EQ(v3_1.Z, 9.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4)
+        {
+            hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
+            
+            {
+                hmm_vec4 result = HMM_AddVec4(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Add(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+            {
+                hmm_vec4 result = v4_1 + v4_2;
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+
+            v4_1 += v4_2;
+            EXPECT_FLOAT_EQ(v4_1.X, 6.0f);
+            EXPECT_FLOAT_EQ(v4_1.Y, 8.0f);
+            EXPECT_FLOAT_EQ(v4_1.Z, 10.0f);
+            EXPECT_FLOAT_EQ(v4_1.W, 12.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4)
+        {
+            hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
+            hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
+
+            // Fill the matrices
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_1.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_2.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_mat4 result = HMM_AddMat4(m4_1, m4_2);
+                float Expected = 18.0f;
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected);
+                        Expected += 2.0f;
+                    }
+                }
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_mat4 result = HMM_Add(m4_1, m4_2);
+                float Expected = 18.0f;
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
+                        Expected += 2.0f;
+                    }
+                }
+            }
+            {
+                hmm_mat4 result = m4_1 + m4_2;
+                float Expected = 18.0f;
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
+                        Expected += 2.0f;
+                    }
+                }
+            }
+
+            m4_1 += m4_2;
+            float Expected = 18.0f;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    EXPECT_FLOAT_EQ(m4_1.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
+                    Expected += 2.0f;
+                }
+            }
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Quaternion)
+        {
+            hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                hmm_quaternion result = HMM_AddQuaternion(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Add(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+            {
+                hmm_quaternion result = q1 + q2;
+                EXPECT_FLOAT_EQ(result.X, 6.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+
+            q1 += q2;
+            EXPECT_FLOAT_EQ(q1.X, 6.0f);
+            EXPECT_FLOAT_EQ(q1.Y, 8.0f);
+            EXPECT_FLOAT_EQ(q1.Z, 10.0f);
+            EXPECT_FLOAT_EQ(q1.W, 12.0f);
+#endif
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Subtraction)
+    {
+        TEST_BEGIN(Vec2)
+        {
+            hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
+            hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
+
+            {
+                hmm_vec2 result = HMM_SubtractVec2(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, -2.0f);
+                EXPECT_FLOAT_EQ(result.Y, -2.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Subtract(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, -2.0f);
+                EXPECT_FLOAT_EQ(result.Y, -2.0f);
+            }
+            {
+                hmm_vec2 result = v2_1 - v2_2;
+                EXPECT_FLOAT_EQ(result.X, -2.0f);
+                EXPECT_FLOAT_EQ(result.Y, -2.0f);
+            }
+
+            v2_1 -= v2_2;
+            EXPECT_FLOAT_EQ(v2_1.X, -2.0f);
+            EXPECT_FLOAT_EQ(v2_1.Y, -2.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3)
+        {
+            hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
+
+            {
+                hmm_vec3 result = HMM_SubtractVec3(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, -3.0f);
+                EXPECT_FLOAT_EQ(result.Y, -3.0f);
+                EXPECT_FLOAT_EQ(result.Z, -3.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Subtract(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, -3.0f);
+                EXPECT_FLOAT_EQ(result.Y, -3.0f);
+                EXPECT_FLOAT_EQ(result.Z, -3.0f);
+            }
+            {
+                hmm_vec3 result = v3_1 - v3_2;
+                EXPECT_FLOAT_EQ(result.X, -3.0f);
+                EXPECT_FLOAT_EQ(result.Y, -3.0f);
+                EXPECT_FLOAT_EQ(result.Z, -3.0f);
+            }
+
+            v3_1 -= v3_2;
+            EXPECT_FLOAT_EQ(v3_1.X, -3.0f);
+            EXPECT_FLOAT_EQ(v3_1.Y, -3.0f);
+            EXPECT_FLOAT_EQ(v3_1.Z, -3.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4)
+        {
+            hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                hmm_vec4 result = HMM_SubtractVec4(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Subtract(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+            {
+                hmm_vec4 result = v4_1 - v4_2;
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+
+            v4_1 -= v4_2;
+            EXPECT_FLOAT_EQ(v4_1.X, -4.0f);
+            EXPECT_FLOAT_EQ(v4_1.Y, -4.0f);
+            EXPECT_FLOAT_EQ(v4_1.Z, -4.0f);
+            EXPECT_FLOAT_EQ(v4_1.W, -4.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4)
+        {
+            hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
+            hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
+
+            // Fill the matrices
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_1.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_2.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_mat4 result = HMM_SubtractMat4(m4_1, m4_2);
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f);
+                    }
+                }
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_mat4 result = HMM_Subtract(m4_1, m4_2);
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
+                    }
+                }
+            }
+            {
+                hmm_mat4 result = m4_1 - m4_2;
+                for (int Column = 0; Column < 4; ++Column)
+                {
+                    for (int Row = 0; Row < 4; ++Row)
+                    {
+                        EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
+                    }
+                }
+            }
+
+            m4_1 -= m4_2;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    EXPECT_FLOAT_EQ(m4_1.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
+                }
+            }
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Quaternion)
+        {
+            hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                hmm_quaternion result = HMM_SubtractQuaternion(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Subtract(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+            {
+                hmm_quaternion result = q1 - q2;
+                EXPECT_FLOAT_EQ(result.X, -4.0f);
+                EXPECT_FLOAT_EQ(result.Y, -4.0f);
+                EXPECT_FLOAT_EQ(result.Z, -4.0f);
+                EXPECT_FLOAT_EQ(result.W, -4.0f);
+            }
+
+            q1 -= q2;
+            EXPECT_FLOAT_EQ(q1.X, -4.0f);
+            EXPECT_FLOAT_EQ(q1.Y, -4.0f);
+            EXPECT_FLOAT_EQ(q1.Z, -4.0f);
+            EXPECT_FLOAT_EQ(q1.W, -4.0f);
+#endif
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Multiplication)
+    {
+        TEST_BEGIN(Vec2Vec2)
+        {
+            hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
+            hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
+
+            {
+                hmm_vec2 result = HMM_MultiplyVec2(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Multiply(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+            }
+            {
+                hmm_vec2 result = v2_1 * v2_2;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 8.0f);
+            }
+
+            v2_1 *= v2_2;
+            EXPECT_FLOAT_EQ(v2_1.X, 3.0f);
+            EXPECT_FLOAT_EQ(v2_1.Y, 8.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec2Scalar)
+        {
+            hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
+            float s = 3.0f;
+
+            {
+                hmm_vec2 result = HMM_MultiplyVec2f(v2, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Multiply(v2, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+            {
+                hmm_vec2 result = v2 * s;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+            {
+                hmm_vec2 result = s * v2;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+            }
+
+            v2 *= s;
+            EXPECT_FLOAT_EQ(v2.X, 3.0f);
+            EXPECT_FLOAT_EQ(v2.Y, 6.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3Vec3)
+        {
+            hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
+
+            {
+                hmm_vec3 result = HMM_MultiplyVec3(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 10.0f);
+                EXPECT_FLOAT_EQ(result.Z, 18.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Multiply(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 10.0f);
+                EXPECT_FLOAT_EQ(result.Z, 18.0f);
+            }
+            {
+                hmm_vec3 result = v3_1 * v3_2;
+                EXPECT_FLOAT_EQ(result.X, 4.0f);
+                EXPECT_FLOAT_EQ(result.Y, 10.0f);
+                EXPECT_FLOAT_EQ(result.Z, 18.0f);
+            }
+
+            v3_1 *= v3_2;
+            EXPECT_FLOAT_EQ(v3_1.X, 4.0f);
+            EXPECT_FLOAT_EQ(v3_1.Y, 10.0f);
+            EXPECT_FLOAT_EQ(v3_1.Z, 18.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3Scalar)
+        {
+            hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            float s = 3.0f;
+
+            {
+                hmm_vec3 result = HMM_MultiplyVec3f(v3, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Multiply(v3, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+            {
+                hmm_vec3 result = v3 * s;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+            {
+                hmm_vec3 result = s * v3;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+            }
+
+            v3 *= s;
+            EXPECT_FLOAT_EQ(v3.X, 3.0f);
+            EXPECT_FLOAT_EQ(v3.Y, 6.0f);
+            EXPECT_FLOAT_EQ(v3.Z, 9.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4Vec4)
+        {
+            hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                hmm_vec4 result = HMM_MultiplyVec4(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 12.0f);
+                EXPECT_FLOAT_EQ(result.Z, 21.0f);
+                EXPECT_FLOAT_EQ(result.W, 32.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Multiply(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 12.0f);
+                EXPECT_FLOAT_EQ(result.Z, 21.0f);
+                EXPECT_FLOAT_EQ(result.W, 32.0f);
+            }
+            {
+                hmm_vec4 result = v4_1 * v4_2;
+                EXPECT_FLOAT_EQ(result.X, 5.0f);
+                EXPECT_FLOAT_EQ(result.Y, 12.0f);
+                EXPECT_FLOAT_EQ(result.Z, 21.0f);
+                EXPECT_FLOAT_EQ(result.W, 32.0f);
+            }
+
+            v4_1 *= v4_2;
+            EXPECT_FLOAT_EQ(v4_1.X, 5.0f);
+            EXPECT_FLOAT_EQ(v4_1.Y, 12.0f);
+            EXPECT_FLOAT_EQ(v4_1.Z, 21.0f);
+            EXPECT_FLOAT_EQ(v4_1.W, 32.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4Scalar)
+        {
+            hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            float s = 3.0f;
+
+            {
+                hmm_vec4 result = HMM_MultiplyVec4f(v4, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Multiply(v4, s);
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+            {
+                hmm_vec4 result = v4 * s;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+            {
+                hmm_vec4 result = s * v4;
+                EXPECT_FLOAT_EQ(result.X, 3.0f);
+                EXPECT_FLOAT_EQ(result.Y, 6.0f);
+                EXPECT_FLOAT_EQ(result.Z, 9.0f);
+                EXPECT_FLOAT_EQ(result.W, 12.0f);
+            }
+
+            v4 *= s;
+            EXPECT_FLOAT_EQ(v4.X, 3.0f);
+            EXPECT_FLOAT_EQ(v4.Y, 6.0f);
+            EXPECT_FLOAT_EQ(v4.Z, 9.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4Mat4)
+        {
+            hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
+            hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
+
+            // Fill the matrices
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_1.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4_2.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_mat4 result = HMM_MultiplyMat4(m4_1, m4_2);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_mat4 result = HMM_Multiply(m4_1, m4_2);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
+            }
+            {
+                hmm_mat4 result = m4_1 * m4_2;
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
+            }
+
+            // At the time I wrote this, I intentionally omitted
+            // the *= operator for matrices because matrix
+            // multiplication is not commutative. (bvisness)
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4Scalar)
+        {
+            hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
+            float s = 3;
+
+            // Fill the matrix
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_mat4 result = HMM_MultiplyMat4f(m4, s);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_mat4 result = HMM_Multiply(m4, s);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
+            }
+            {
+                hmm_mat4 result = m4 * s;
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
+            }
+            {
+                hmm_mat4 result = s * m4;
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
+            }
+
+            m4 *= s;
+            EXPECT_FLOAT_EQ(m4.Elements[0][0], 3.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][1], 6.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][2], 9.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][3], 12.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][0], 15.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][1], 18.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][2], 21.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][3], 24.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][0], 27.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][1], 30.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][2], 33.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][3], 36.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][0], 39.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][1], 42.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][2], 45.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][3], 48.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4Vec4)
+        {
+            hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
+            hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+
+            // Fill the matrix
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_vec4 result = HMM_MultiplyMat4ByVec4(m4, v4);
+                EXPECT_FLOAT_EQ(result.X, 90.0f);
+                EXPECT_FLOAT_EQ(result.Y, 100.0f);
+                EXPECT_FLOAT_EQ(result.Z, 110.0f);
+                EXPECT_FLOAT_EQ(result.W, 120.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Multiply(m4, v4);
+                EXPECT_FLOAT_EQ(result.X, 90.0f);
+                EXPECT_FLOAT_EQ(result.Y, 100.0f);
+                EXPECT_FLOAT_EQ(result.Z, 110.0f);
+                EXPECT_FLOAT_EQ(result.W, 120.0f);
+            }
+            {
+                hmm_vec4 result = m4 * v4;
+                EXPECT_FLOAT_EQ(result.X, 90.0f);
+                EXPECT_FLOAT_EQ(result.Y, 100.0f);
+                EXPECT_FLOAT_EQ(result.Z, 110.0f);
+                EXPECT_FLOAT_EQ(result.W, 120.0f);
+            }
+
+            // *= makes no sense for this particular case.
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(QuaternionQuaternion)
+        {
+            hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
+
+            {
+                hmm_quaternion result = HMM_MultiplyQuaternion(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, 24.0f);
+                EXPECT_FLOAT_EQ(result.Y, 48.0f);
+                EXPECT_FLOAT_EQ(result.Z, 48.0f);
+                EXPECT_FLOAT_EQ(result.W, -6.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Multiply(q1, q2);
+                EXPECT_FLOAT_EQ(result.X, 24.0f);
+                EXPECT_FLOAT_EQ(result.Y, 48.0f);
+                EXPECT_FLOAT_EQ(result.Z, 48.0f);
+                EXPECT_FLOAT_EQ(result.W, -6.0f);
+            }
+            {
+                hmm_quaternion result = q1 * q2;
+                EXPECT_FLOAT_EQ(result.X, 24.0f);
+                EXPECT_FLOAT_EQ(result.Y, 48.0f);
+                EXPECT_FLOAT_EQ(result.Z, 48.0f);
+                EXPECT_FLOAT_EQ(result.W, -6.0f);
+            }
+
+            // Like with matrices, we're not implementing the *=
+            // operator for quaternions because quaternion multiplication
+            // is not commutative.
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(QuaternionScalar)
+        {
+            hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            float f = 2.0f;
+
+            {
+                hmm_quaternion result = HMM_MultiplyQuaternionF(q, f);
+                EXPECT_FLOAT_EQ(result.X, 2.0f);
+                EXPECT_FLOAT_EQ(result.Y, 4.0f);
+                EXPECT_FLOAT_EQ(result.Z, 6.0f);
+                EXPECT_FLOAT_EQ(result.W, 8.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Multiply(q, f);
+                EXPECT_FLOAT_EQ(result.X, 2.0f);
+                EXPECT_FLOAT_EQ(result.Y, 4.0f);
+                EXPECT_FLOAT_EQ(result.Z, 6.0f);
+                EXPECT_FLOAT_EQ(result.W, 8.0f);
+            }
+            {
+                hmm_quaternion result = q * f;
+                EXPECT_FLOAT_EQ(result.X, 2.0f);
+                EXPECT_FLOAT_EQ(result.Y, 4.0f);
+                EXPECT_FLOAT_EQ(result.Z, 6.0f);
+                EXPECT_FLOAT_EQ(result.W, 8.0f);
+            }
+            {
+                hmm_quaternion result = f * q;
+                EXPECT_FLOAT_EQ(result.X, 2.0f);
+                EXPECT_FLOAT_EQ(result.Y, 4.0f);
+                EXPECT_FLOAT_EQ(result.Z, 6.0f);
+                EXPECT_FLOAT_EQ(result.W, 8.0f);
+            }
+
+            q *= f;
+            EXPECT_FLOAT_EQ(q.X, 2.0f);
+            EXPECT_FLOAT_EQ(q.Y, 4.0f);
+            EXPECT_FLOAT_EQ(q.Z, 6.0f);
+            EXPECT_FLOAT_EQ(q.W, 8.0f);
+#endif
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Division)
+    {
+        TEST_BEGIN(Vec2Vec2)
+        {
+            hmm_vec2 v2_1 = HMM_Vec2(1.0f, 3.0f);
+            hmm_vec2 v2_2 = HMM_Vec2(2.0f, 4.0f);
+
+            {
+                hmm_vec2 result = HMM_DivideVec2(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Divide(v2_1, v2_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+            }
+            {
+                hmm_vec2 result = v2_1 / v2_2;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+            }
+
+            v2_1 /= v2_2;
+            EXPECT_FLOAT_EQ(v2_1.X, 0.5f);
+            EXPECT_FLOAT_EQ(v2_1.Y, 0.75f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec2Scalar)
+        {
+            hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
+            float s = 2;
+
+            {
+                hmm_vec2 result = HMM_DivideVec2f(v2, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec2 result = HMM_Divide(v2, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+            }
+            {
+                hmm_vec2 result = v2 / s;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+            }
+
+            v2 /= s;
+            EXPECT_FLOAT_EQ(v2.X, 0.5f);
+            EXPECT_FLOAT_EQ(v2.Y, 1.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3Vec3)
+        {
+            hmm_vec3 v3_1 = HMM_Vec3(1.0f, 3.0f, 5.0f);
+            hmm_vec3 v3_2 = HMM_Vec3(2.0f, 4.0f, 0.5f);
+
+            {
+                hmm_vec3 result = HMM_DivideVec3(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Divide(v3_1, v3_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+            }
+            {
+                hmm_vec3 result = v3_1 / v3_2;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+            }
+
+            v3_1 /= v3_2;
+            EXPECT_FLOAT_EQ(v3_1.X, 0.5f);
+            EXPECT_FLOAT_EQ(v3_1.Y, 0.75f);
+            EXPECT_FLOAT_EQ(v3_1.Z, 10.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec3Scalar)
+        {
+            hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            float s = 2;
+
+            {
+                hmm_vec3 result = HMM_DivideVec3f(v3, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec3 result = HMM_Divide(v3, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+            }
+            {
+                hmm_vec3 result = v3 / s;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+            }
+
+            v3 /= s;
+            EXPECT_FLOAT_EQ(v3.X, 0.5f);
+            EXPECT_FLOAT_EQ(v3.Y, 1.0f);
+            EXPECT_FLOAT_EQ(v3.Z, 1.5f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4Vec4)
+        {
+            hmm_vec4 v4_1 = HMM_Vec4(1.0f, 3.0f, 5.0f, 1.0f);
+            hmm_vec4 v4_2 = HMM_Vec4(2.0f, 4.0f, 0.5f, 4.0f);
+
+            {
+                hmm_vec4 result = HMM_DivideVec4(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 0.25f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Divide(v4_1, v4_2);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 0.25f);
+            }
+            {
+                hmm_vec4 result = v4_1 / v4_2;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 0.75f);
+                EXPECT_FLOAT_EQ(result.Z, 10.0f);
+                EXPECT_FLOAT_EQ(result.W, 0.25f);
+            }
+
+            v4_1 /= v4_2;
+            EXPECT_FLOAT_EQ(v4_1.X, 0.5f);
+            EXPECT_FLOAT_EQ(v4_1.Y, 0.75f);
+            EXPECT_FLOAT_EQ(v4_1.Z, 10.0f);
+            EXPECT_FLOAT_EQ(v4_1.W, 0.25f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Vec4Scalar)
+        {
+            hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
+            float s = 2;
+
+            {
+                hmm_vec4 result = HMM_DivideVec4f(v4, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_vec4 result = HMM_Divide(v4, s);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+            {
+                hmm_vec4 result = v4 / s;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+
+            v4 /= s;
+            EXPECT_FLOAT_EQ(v4.X, 0.5f);
+            EXPECT_FLOAT_EQ(v4.Y, 1.0f);
+            EXPECT_FLOAT_EQ(v4.Z, 1.5f);
+            EXPECT_FLOAT_EQ(v4.W, 2.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(Mat4Scalar)
+        {
+            hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
+            float s = 2;
+
+            // Fill the matrix
+            int Counter = 1;
+            for (int Column = 0; Column < 4; ++Column)
+            {
+                for (int Row = 0; Row < 4; ++Row)
+                {
+                    m4.Elements[Column][Row] = Counter;
+                    ++Counter;
+                }
+            }
+
+            // Test the results
+            {
+                hmm_mat4 result = HMM_DivideMat4f(m4, s);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_mat4 result = HMM_Divide(m4, s);
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
+            }
+            {
+                hmm_mat4 result = m4 / s;
+                EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
+                EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
+                EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
+                EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
+                EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
+                EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
+                EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
+                EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
+                EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
+            }
+
+            m4 /= s;
+            EXPECT_FLOAT_EQ(m4.Elements[0][0], 0.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][1], 1.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][2], 1.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[0][3], 2.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][0], 2.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][1], 3.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][2], 3.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[1][3], 4.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][0], 4.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][1], 5.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][2], 5.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[2][3], 6.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][0], 6.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][1], 7.0f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][2], 7.5f);
+            EXPECT_FLOAT_EQ(m4.Elements[3][3], 8.0f);
+#endif
+        }
+        TEST_END()
+
+        TEST_BEGIN(QuaternionScalar)
+        {
+            hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
+            float f = 2.0f;
+
+            {
+                hmm_quaternion result = HMM_DivideQuaternionF(q, f);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+#ifdef HANDMADE_MATH_CPP_MODE
+            {
+                hmm_quaternion result = HMM_Divide(q, f);
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+            {
+                hmm_quaternion result = q / f;
+                EXPECT_FLOAT_EQ(result.X, 0.5f);
+                EXPECT_FLOAT_EQ(result.Y, 1.0f);
+                EXPECT_FLOAT_EQ(result.Z, 1.5f);
+                EXPECT_FLOAT_EQ(result.W, 2.0f);
+            }
+
+            q /= f;
+            EXPECT_FLOAT_EQ(q.X, 0.5f);
+            EXPECT_FLOAT_EQ(q.Y, 1.0f);
+            EXPECT_FLOAT_EQ(q.Z, 1.5f);
+            EXPECT_FLOAT_EQ(q.W, 2.0f);
+#endif
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Projection)
+    {
+        TEST_BEGIN(Orthographic)
+        {
+            hmm_mat4 projection = HMM_Orthographic(-10.0f, 10.0f, -5.0f, 5.0f, 0.0f, -10.0f);
+
+            hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -5.0f);
+            hmm_vec4 projected = HMM_MultiplyMat4ByVec4(projection, HMM_Vec4v(original, 1));
+
+            EXPECT_FLOAT_EQ(projected.X, 0.5f);
+            EXPECT_FLOAT_EQ(projected.Y, 1.0f);
+            EXPECT_FLOAT_EQ(projected.Z, -2.0f);
+            EXPECT_FLOAT_EQ(projected.W, 1.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Perspective)
+        {
+            hmm_mat4 projection = HMM_Perspective(90.0f, 2.0f, 5.0f, 15.0f);
+
+            {
+                hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -15.0f);
+                hmm_vec4 projected = HMM_MultiplyMat4ByVec4(projection, HMM_Vec4v(original, 1));
+                EXPECT_FLOAT_EQ(projected.X, 5.0f);
+                EXPECT_FLOAT_EQ(projected.Y, 10.0f);
+                EXPECT_FLOAT_EQ(projected.Z, 15.0f);
+                EXPECT_FLOAT_EQ(projected.W, 15.0f);
+            }
+            {
+                hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -5.0f);
+                hmm_vec4 projected = HMM_MultiplyMat4ByVec4(projection, HMM_Vec4v(original, 1));
+                EXPECT_FLOAT_EQ(projected.X, 5.0f);
+                EXPECT_FLOAT_EQ(projected.Y, 10.0f);
+                EXPECT_FLOAT_EQ(projected.Z, -5.0f);
+                EXPECT_FLOAT_EQ(projected.W, 5.0f);
+            }
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    CATEGORY_BEGIN(Transformations)
+    {
+        TEST_BEGIN(Translate)
+        {
+            hmm_mat4 translate = HMM_Translate(HMM_Vec3(1.0f, -3.0f, 6.0f));
+
+            hmm_vec3 original = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec4 translated = HMM_MultiplyMat4ByVec4(translate, HMM_Vec4v(original, 1));
+
+            EXPECT_FLOAT_EQ(translated.X, 2.0f);
+            EXPECT_FLOAT_EQ(translated.Y, -1.0f);
+            EXPECT_FLOAT_EQ(translated.Z, 9.0f);
+            EXPECT_FLOAT_EQ(translated.W, 1.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Rotate)
+        {
+            hmm_vec3 original = HMM_Vec3(1.0f, 1.0f, 1.0f);
+
+            hmm_mat4 rotateX = HMM_Rotate(90, HMM_Vec3(1, 0, 0));
+            hmm_vec4 rotatedX = HMM_MultiplyMat4ByVec4(rotateX, HMM_Vec4v(original, 1));
+            EXPECT_FLOAT_EQ(rotatedX.X, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedX.Y, -1.0f);
+            EXPECT_FLOAT_EQ(rotatedX.Z, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedX.W, 1.0f);
+
+            hmm_mat4 rotateY = HMM_Rotate(90, HMM_Vec3(0, 1, 0));
+            hmm_vec4 rotatedY = HMM_MultiplyMat4ByVec4(rotateY, HMM_Vec4v(original, 1));
+            EXPECT_FLOAT_EQ(rotatedY.X, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedY.Y, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedY.Z, -1.0f);
+            EXPECT_FLOAT_EQ(rotatedY.W, 1.0f);
+
+            hmm_mat4 rotateZ = HMM_Rotate(90, HMM_Vec3(0, 0, 1));
+            hmm_vec4 rotatedZ = HMM_MultiplyMat4ByVec4(rotateZ, HMM_Vec4v(original, 1));
+            EXPECT_FLOAT_EQ(rotatedZ.X, -1.0f);
+            EXPECT_FLOAT_EQ(rotatedZ.Y, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedZ.Z, 1.0f);
+            EXPECT_FLOAT_EQ(rotatedZ.W, 1.0f);
+        }
+        TEST_END()
+
+        TEST_BEGIN(Scale)
+        {
+            hmm_mat4 scale = HMM_Scale(HMM_Vec3(2.0f, -3.0f, 0.5f));
+
+            hmm_vec3 original = HMM_Vec3(1.0f, 2.0f, 3.0f);
+            hmm_vec4 scaled = HMM_MultiplyMat4ByVec4(scale, HMM_Vec4v(original, 1));
+
+            EXPECT_FLOAT_EQ(scaled.X, 2.0f);
+            EXPECT_FLOAT_EQ(scaled.Y, -6.0f);
+            EXPECT_FLOAT_EQ(scaled.Z, 1.5f);
+            EXPECT_FLOAT_EQ(scaled.W, 1.0f);
+        }
+        TEST_END()
+    }
+    CATEGORY_END()
+
+    return 0;
+}
diff --git a/test/hmm_test.cpp b/test/hmm_test.cpp
--- a/test/hmm_test.cpp
+++ b/test/hmm_test.cpp
@@ -1,1747 +1,2 @@
-
-#define HANDMADE_MATH_CPP_MODE
-#include "../HandmadeMath.h"
-
-#include "gtest/gtest.h"
-
-
-TEST(ScalarMath, Trigonometry)
-{
-    // We have to be a little looser with our equality constraint
-    // because of floating-point precision issues.
-    const float trigAbsError = 0.0001f;
-
-    EXPECT_NEAR(HMM_SinF(0.0f), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_SinF(HMM_PI32 / 2), 1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_SinF(HMM_PI32), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_SinF(3 * HMM_PI32 / 2), -1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_SinF(-HMM_PI32 / 2), -1.0f, trigAbsError);
-
-    EXPECT_NEAR(HMM_CosF(0.0f), 1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_CosF(HMM_PI32 / 2), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_CosF(HMM_PI32), -1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_CosF(3 * HMM_PI32 / 2), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_CosF(-HMM_PI32), -1.0f, trigAbsError);
-
-    EXPECT_NEAR(HMM_TanF(0.0f), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_TanF(HMM_PI32 / 4), 1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_TanF(3 * HMM_PI32 / 4), -1.0f, trigAbsError);
-    EXPECT_NEAR(HMM_TanF(HMM_PI32), 0.0f, trigAbsError);
-    EXPECT_NEAR(HMM_TanF(-HMM_PI32 / 4), -1.0f, trigAbsError);
-
-    // This isn't the most rigorous because we're really just sanity-
-    // checking that things work by default.
-}
-
-TEST(ScalarMath, ToRadians)
-{
-    EXPECT_FLOAT_EQ(HMM_ToRadians(0.0f), 0);
-    EXPECT_FLOAT_EQ(HMM_ToRadians(180.0f), HMM_PI32);
-    EXPECT_FLOAT_EQ(HMM_ToRadians(-180.0f), -HMM_PI32);
-}
-
-TEST(ScalarMath, SquareRoot)
-{
-    EXPECT_FLOAT_EQ(HMM_SquareRootF(16.0f), 4.0f);
-}
-
-TEST(ScalarMath, RSquareRootF)
-{
-    EXPECT_FLOAT_EQ(HMM_RSquareRootF(10.0f), 0.31616211f);
-}
-
-TEST(ScalarMath, Power)
-{
-    EXPECT_FLOAT_EQ(HMM_Power(2.0f, 0), 1.0f);
-    EXPECT_FLOAT_EQ(HMM_Power(2.0f, 4), 16.0f);       
-    EXPECT_FLOAT_EQ(HMM_Power(2.0f, -2), 0.25f);
-}
-
-TEST(ScalarMath, PowerF)
-{
-    EXPECT_FLOAT_EQ(HMM_PowerF(2.0f, 0), 1.0f);
-    EXPECT_NEAR(HMM_PowerF(2.0f, 4.1), 17.148376f, 0.0001f);
-    EXPECT_NEAR(HMM_PowerF(2.0f, -2.5), 0.176777f, 0.0001f);
-}
-
-TEST(ScalarMath, Lerp)
-{
-    EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 0.0f, 2.0f), -2.0f);        
-    EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 0.5f, 2.0f), 0.0f);        
-    EXPECT_FLOAT_EQ(HMM_Lerp(-2.0f, 1.0f, 2.0f), 2.0f);
-}
-
-TEST(ScalarMath, Clamp)
-{
-    EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, 0.0f, 2.0f), 0.0f);        
-    EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, -3.0f, 2.0f), -2.0f);        
-    EXPECT_FLOAT_EQ(HMM_Clamp(-2.0f, 3.0f, 2.0f), 2.0f);
-}
-
-TEST(Initialization, Vectors)
-{
-    //
-    // Test vec2
-    // 
-    hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
-    hmm_vec2 v2i = HMM_Vec2(1, 2);
-
-    EXPECT_FLOAT_EQ(v2.X, 1.0f);
-    EXPECT_FLOAT_EQ(v2.Y, 2.0f);
-
-    EXPECT_FLOAT_EQ(v2i.X, 1.0f);
-    EXPECT_FLOAT_EQ(v2i.Y, 2.0f);
-
-    //
-    // Test vec3
-    //
-    hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v3i = HMM_Vec3i(1, 2, 3);
-
-    EXPECT_FLOAT_EQ(v3.X, 1.0f);
-    EXPECT_FLOAT_EQ(v3.Y, 2.0f);
-    EXPECT_FLOAT_EQ(v3.Z, 3.0f);
-
-    EXPECT_FLOAT_EQ(v3i.X, 1.0f);
-    EXPECT_FLOAT_EQ(v3i.Y, 2.0f);
-    EXPECT_FLOAT_EQ(v3i.Z, 3.0f);
-
-    //
-    // Test vec4
-    //
-    hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_vec4 v4i = HMM_Vec4i(1, 2, 3, 4);
-    hmm_vec4 v4v = HMM_Vec4v(v3, 4.0f);
-
-    EXPECT_FLOAT_EQ(v4.X, 1.0f);
-    EXPECT_FLOAT_EQ(v4.Y, 2.0f);
-    EXPECT_FLOAT_EQ(v4.Z, 3.0f);
-    EXPECT_FLOAT_EQ(v4.W, 4.0f);
-
-    EXPECT_FLOAT_EQ(v4i.X, 1.0f);
-    EXPECT_FLOAT_EQ(v4i.Y, 2.0f);
-    EXPECT_FLOAT_EQ(v4i.Z, 3.0f);
-    EXPECT_FLOAT_EQ(v4i.W, 4.0f);
-
-    EXPECT_FLOAT_EQ(v4v.X, 1.0f);
-    EXPECT_FLOAT_EQ(v4v.Y, 2.0f);
-    EXPECT_FLOAT_EQ(v4v.Z, 3.0f);
-    EXPECT_FLOAT_EQ(v4v.W, 4.0f);
-}
-
-TEST(Initialization, MatrixEmpty)
-{
-    hmm_mat4 m4 = HMM_Mat4();
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            EXPECT_FLOAT_EQ(m4.Elements[Column][Row], 0) << "At column " << Column << ", row " << Row;
-        }
-    }
-}
-
-TEST(Initialization, MatrixDiagonal)
-{
-    hmm_mat4 m4d = HMM_Mat4d(1.0f);
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            if (Column == Row) {
-                EXPECT_FLOAT_EQ(m4d.Elements[Column][Row], 1.0f) << "At column " << Column << ", row " << Row;
-            } else {
-                EXPECT_FLOAT_EQ(m4d.Elements[Column][Row], 0) << "At column " << Column << ", row " << Row;
-            }
-        }
-    }
-}
-
-TEST(Initialization, Quaternion)
-{
-    hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-
-    EXPECT_FLOAT_EQ(q.X, 1.0f);
-    EXPECT_FLOAT_EQ(q.Y, 2.0f);
-    EXPECT_FLOAT_EQ(q.Z, 3.0f);
-    EXPECT_FLOAT_EQ(q.W, 4.0f);
-
-    EXPECT_FLOAT_EQ(q.Elements[0], 1.0f);
-    EXPECT_FLOAT_EQ(q.Elements[1], 2.0f);
-    EXPECT_FLOAT_EQ(q.Elements[2], 3.0f);
-    EXPECT_FLOAT_EQ(q.Elements[3], 4.0f);
-
-    hmm_vec4 v = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion qv = HMM_QuaternionV4(v);
-
-    EXPECT_FLOAT_EQ(qv.X, 1.0f);
-    EXPECT_FLOAT_EQ(qv.Y, 2.0f);
-    EXPECT_FLOAT_EQ(qv.Z, 3.0f);
-    EXPECT_FLOAT_EQ(qv.W, 4.0f);
-}
-
-TEST(VectorOps, LengthSquared)
-{
-    hmm_vec2 v2 = HMM_Vec2(1.0f, -2.0f);
-    hmm_vec3 v3 = HMM_Vec3(1.0f, -2.0f, 3.0f); 
-    hmm_vec4 v4 = HMM_Vec4(1.0f, -2.0f, 3.0f, 1.0f);
-
-    EXPECT_FLOAT_EQ(HMM_LengthSquaredVec2(v2), 5.0f);
-    EXPECT_FLOAT_EQ(HMM_LengthSquaredVec3(v3), 14.0f);
-    EXPECT_FLOAT_EQ(HMM_LengthSquaredVec4(v4), 15.0f);
-
-    EXPECT_FLOAT_EQ(HMM_LengthSquared(v2), 5.0f);
-    EXPECT_FLOAT_EQ(HMM_LengthSquared(v3), 14.0f);
-    EXPECT_FLOAT_EQ(HMM_LengthSquared(v4), 15.0f);
-}
-
-TEST(VectorOps, Length)
-{
-    hmm_vec2 v2 = HMM_Vec2(1.0f, -9.0f);
-    hmm_vec3 v3 = HMM_Vec3(2.0f, -3.0f, 6.0f);
-    hmm_vec4 v4 = HMM_Vec4(2.0f, -3.0f, 6.0f, 12.0f);
-
-    EXPECT_FLOAT_EQ(HMM_LengthVec2(v2), 9.0553856f);
-    EXPECT_FLOAT_EQ(HMM_LengthVec3(v3), 7.0f);
-    EXPECT_FLOAT_EQ(HMM_LengthVec4(v4), 13.892444f);
-
-    EXPECT_FLOAT_EQ(HMM_Length(v2), 9.0553856f);
-    EXPECT_FLOAT_EQ(HMM_Length(v3), 7.0f);
-    EXPECT_FLOAT_EQ(HMM_Length(v4), 13.892444f);
-}
-
-TEST(VectorOps, Normalize)
-{
-    hmm_vec2 v2 = HMM_Vec2(1.0f, -2.0f);
-    hmm_vec3 v3 = HMM_Vec3(1.0f, -2.0f, 3.0f); 
-    hmm_vec4 v4 = HMM_Vec4(1.0f, -2.0f, 3.0f, -1.0f);
-
-    // Test C functions
-    {
-        hmm_vec2 result = HMM_NormalizeVec2(v2);
-        EXPECT_FLOAT_EQ(HMM_LengthVec2(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-    }
-    {
-        hmm_vec3 result = HMM_NormalizeVec3(v3);
-        EXPECT_FLOAT_EQ(HMM_LengthVec3(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-        EXPECT_GT(result.Z, 0);
-    }
-    {
-        hmm_vec4 result = HMM_NormalizeVec4(v4);
-        EXPECT_FLOAT_EQ(HMM_LengthVec4(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-        EXPECT_GT(result.Z, 0);
-        EXPECT_LT(result.W, 0);
-    }
-
-    // Test C++ functions
-    {
-        hmm_vec2 result = HMM_Normalize(v2);
-        EXPECT_FLOAT_EQ(HMM_LengthVec2(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-    }
-    {
-        hmm_vec3 result = HMM_Normalize(v3);
-        EXPECT_FLOAT_EQ(HMM_LengthVec3(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-        EXPECT_GT(result.Z, 0);
-    }
-    {
-        hmm_vec4 result = HMM_Normalize(v4);
-        EXPECT_FLOAT_EQ(HMM_LengthVec4(result), 1.0f);
-        EXPECT_GT(result.X, 0);
-        EXPECT_LT(result.Y, 0);
-        EXPECT_GT(result.Z, 0);
-        EXPECT_LT(result.W, 0);
-    }
-}
-
-TEST(VectorOps, Cross)
-{
-    hmm_vec3 v1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
-
-    hmm_vec3 result = HMM_Cross(v1, v2);
-
-    EXPECT_FLOAT_EQ(result.X, -3.0f);
-    EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    EXPECT_FLOAT_EQ(result.Z, -3.0f);
-}
-
-TEST(VectorOps, DotVec2)
-{
-    hmm_vec2 v1 = HMM_Vec2(1.0f, 2.0f);
-    hmm_vec2 v2 = HMM_Vec2(3.0f, 4.0f);
-
-    EXPECT_FLOAT_EQ(HMM_DotVec2(v1, v2), 11.0f);
-    EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 11.0f);
-}
-
-TEST(VectorOps, DotVec3)
-{
-    hmm_vec3 v1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
-
-    EXPECT_FLOAT_EQ(HMM_DotVec3(v1, v2), 32.0f);
-    EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 32.0f);
-}
-
-TEST(VectorOps, DotVec4)
-{
-    hmm_vec4 v1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_vec4 v2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
-
-    EXPECT_FLOAT_EQ(HMM_DotVec4(v1, v2), 70.0f);
-    EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 70.0f);
-}
-
-TEST(MatrixOps, Transpose)
-{
-    hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
-
-    // Fill the matrix
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the matrix
-    hmm_mat4 result = HMM_Transpose(m4);
-    EXPECT_FLOAT_EQ(result.Elements[0][0], 1.0f);
-    EXPECT_FLOAT_EQ(result.Elements[0][1], 5.0f);
-    EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
-    EXPECT_FLOAT_EQ(result.Elements[0][3], 13.0f);
-    EXPECT_FLOAT_EQ(result.Elements[1][0], 2.0f);
-    EXPECT_FLOAT_EQ(result.Elements[1][1], 6.0f);
-    EXPECT_FLOAT_EQ(result.Elements[1][2], 10.0f);
-    EXPECT_FLOAT_EQ(result.Elements[1][3], 14.0f);
-    EXPECT_FLOAT_EQ(result.Elements[2][0], 3.0f);
-    EXPECT_FLOAT_EQ(result.Elements[2][1], 7.0f);
-    EXPECT_FLOAT_EQ(result.Elements[2][2], 11.0f);
-    EXPECT_FLOAT_EQ(result.Elements[2][3], 15.0f);
-    EXPECT_FLOAT_EQ(result.Elements[3][0], 4.0f);
-    EXPECT_FLOAT_EQ(result.Elements[3][1], 8.0f);
-    EXPECT_FLOAT_EQ(result.Elements[3][2], 12.0f);
-    EXPECT_FLOAT_EQ(result.Elements[3][3], 16.0f);
-}
-
-TEST(QuaternionOps, Inverse)
-{
-    hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion inverse = HMM_InverseQuaternion(q1);
-
-    hmm_quaternion result = HMM_MultiplyQuaternion(q1, inverse);
-
-    EXPECT_FLOAT_EQ(result.X, 0.0f);
-    EXPECT_FLOAT_EQ(result.Y, 0.0f);
-    EXPECT_FLOAT_EQ(result.Z, 0.0f);
-    EXPECT_FLOAT_EQ(result.W, 1.0f);
-}
-
-TEST(QuaternionOps, Dot)
-{
-    hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        float result = HMM_DotQuaternion(q1, q2);
-        EXPECT_FLOAT_EQ(result, 70.0f);
-    }
-    {
-        float result = HMM_Dot(q1, q2);
-        EXPECT_FLOAT_EQ(result, 70.0f);
-    }
-}
-
-TEST(QuaternionOps, Normalize)
-{
-    hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-
-    {
-        hmm_quaternion result = HMM_NormalizeQuaternion(q);
-        EXPECT_FLOAT_EQ(result.X, 0.1825741858f);
-        EXPECT_FLOAT_EQ(result.Y, 0.3651483717f);
-        EXPECT_FLOAT_EQ(result.Z, 0.5477225575f);
-        EXPECT_FLOAT_EQ(result.W, 0.7302967433f);
-    }
-    {
-        hmm_quaternion result = HMM_Normalize(q);
-        EXPECT_FLOAT_EQ(result.X, 0.1825741858f);
-        EXPECT_FLOAT_EQ(result.Y, 0.3651483717f);
-        EXPECT_FLOAT_EQ(result.Z, 0.5477225575f);
-        EXPECT_FLOAT_EQ(result.W, 0.7302967433f);
-    }
-}
-
-TEST(QuaternionOps, NLerp)
-{
-    hmm_quaternion from = HMM_Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
-    hmm_quaternion to = HMM_Quaternion(0.5f, 0.5f, -0.5f, 0.5f);
-
-    hmm_quaternion result = HMM_NLerp(from, 0.5f, to);
-    EXPECT_FLOAT_EQ(result.X, 0.28867513f);
-    EXPECT_FLOAT_EQ(result.Y, 0.28867513f);
-    EXPECT_FLOAT_EQ(result.Z, -0.28867513f);
-    EXPECT_FLOAT_EQ(result.W, 0.86602540f);
-}
-
-TEST(QuaternionOps, Slerp)
-{
-    hmm_quaternion from = HMM_Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
-    hmm_quaternion to = HMM_Quaternion(0.5f, 0.5f, -0.5f, 0.5f);
-
-    hmm_quaternion result = HMM_Slerp(from, 0.5f, to);
-    EXPECT_FLOAT_EQ(result.X, 0.28867513f);
-    EXPECT_FLOAT_EQ(result.Y, 0.28867513f);
-    EXPECT_FLOAT_EQ(result.Z, -0.28867513f);
-    EXPECT_FLOAT_EQ(result.W, 0.86602540f);
-}
-
-TEST(QuaternionOps, ToMat4)
-{
-    const float abs_error = 0.0001f;
-
-    hmm_quaternion rot = HMM_Quaternion(0.707107f, 0.0f, 0.0f, 0.707107f);
-
-    hmm_mat4 result = HMM_QuaternionToMat4(rot);
-
-    EXPECT_NEAR(result.Elements[0][0], 1.0f, abs_error);
-    EXPECT_NEAR(result.Elements[0][1], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[0][2], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[0][3], 0.0f, abs_error);
-
-    EXPECT_NEAR(result.Elements[1][0], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[1][1], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[1][2], 1.0f, abs_error);
-    EXPECT_NEAR(result.Elements[1][3], 0.0f, abs_error);
-
-    EXPECT_NEAR(result.Elements[2][0], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[2][1], -1.0f, abs_error);
-    EXPECT_NEAR(result.Elements[2][2], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[2][3], 0.0f, abs_error);
-
-    EXPECT_NEAR(result.Elements[3][0], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[3][1], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[3][2], 0.0f, abs_error);
-    EXPECT_NEAR(result.Elements[3][3], 1.0f, abs_error);
-}
-
-TEST(QuaternionOps, FromAxisAngle)
-{
-    hmm_vec3 axis = HMM_Vec3(1.0f, 0.0f, 0.0f);
-    float angle = HMM_PI32 / 2.0f;
-
-    hmm_quaternion result = HMM_QuaternionFromAxisAngle(axis, angle);
-    EXPECT_FLOAT_EQ(result.X, 0.707107f);
-    EXPECT_FLOAT_EQ(result.Y, 0.0f);
-    EXPECT_FLOAT_EQ(result.Z, 0.0f);
-    EXPECT_FLOAT_EQ(result.W, 0.707107f);
-}
-
-TEST(Addition, Vec2)
-{
-    hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
-    hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
-
-    {
-        hmm_vec2 result = HMM_AddVec2(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-    {
-        hmm_vec2 result = HMM_Add(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-    {
-        hmm_vec2 result = v2_1 + v2_2;
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }    
-
-    v2_1 += v2_2;
-    EXPECT_FLOAT_EQ(v2_1.X, 4.0f);
-    EXPECT_FLOAT_EQ(v2_1.Y, 6.0f);
-}
-
-TEST(Addition, Vec3)
-{
-    hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
-
-    {
-        hmm_vec3 result = HMM_AddVec3(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 7.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);    
-    }
-    {
-        hmm_vec3 result = HMM_Add(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 7.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-    {
-        hmm_vec3 result = v3_1 + v3_2;
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 7.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-
-    v3_1 += v3_2;
-    EXPECT_FLOAT_EQ(v3_1.X, 5.0f);
-    EXPECT_FLOAT_EQ(v3_1.Y, 7.0f);
-    EXPECT_FLOAT_EQ(v3_1.Z, 9.0f);
-}
-
-TEST(Addition, Vec4)
-{
-    hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
-    
-    {
-        hmm_vec4 result = HMM_AddVec4(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_vec4 result = HMM_Add(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_vec4 result = v4_1 + v4_2;
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-
-    v4_1 += v4_2;
-    EXPECT_FLOAT_EQ(v4_1.X, 6.0f);
-    EXPECT_FLOAT_EQ(v4_1.Y, 8.0f);
-    EXPECT_FLOAT_EQ(v4_1.Z, 10.0f);
-    EXPECT_FLOAT_EQ(v4_1.W, 12.0f);
-}
-
-TEST(Addition, Mat4)
-{
-    hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
-    hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
-
-    // Fill the matrices
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_1.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_2.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_mat4 result = HMM_AddMat4(m4_1, m4_2);
-        float Expected = 18.0f;
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
-                Expected += 2.0f;
-            }
-        }
-    }
-    {
-        hmm_mat4 result = HMM_Add(m4_1, m4_2);
-        float Expected = 18.0f;
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
-                Expected += 2.0f;
-            }
-        }
-    }
-    {
-        hmm_mat4 result = m4_1 + m4_2;
-        float Expected = 18.0f;
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
-                Expected += 2.0f;
-            }
-        }
-    }
-
-    m4_1 += m4_2;
-    float Expected = 18.0f;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            EXPECT_FLOAT_EQ(m4_1.Elements[Column][Row], Expected) << "At column " << Column << ", row " << Row;
-            Expected += 2.0f;
-        }
-    }
-}
-
-TEST(Addition, Quaternion)
-{
-    hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        hmm_quaternion result = HMM_AddQuaternion(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_quaternion result = HMM_Add(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_quaternion result = q1 + q2;
-        EXPECT_FLOAT_EQ(result.X, 6.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-
-    q1 += q2;
-    EXPECT_FLOAT_EQ(q1.X, 6.0f);
-    EXPECT_FLOAT_EQ(q1.Y, 8.0f);
-    EXPECT_FLOAT_EQ(q1.Z, 10.0f);
-    EXPECT_FLOAT_EQ(q1.W, 12.0f);
-}
-
-TEST(Subtraction, Vec2)
-{
-    hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
-    hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
-
-    {
-        hmm_vec2 result = HMM_SubtractVec2(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, -2.0f);
-        EXPECT_FLOAT_EQ(result.Y, -2.0f);
-    }
-    {
-        hmm_vec2 result = HMM_Subtract(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, -2.0f);
-        EXPECT_FLOAT_EQ(result.Y, -2.0f);
-    }
-    {
-        hmm_vec2 result = v2_1 - v2_2;
-        EXPECT_FLOAT_EQ(result.X, -2.0f);
-        EXPECT_FLOAT_EQ(result.Y, -2.0f);
-    }
-
-    v2_1 -= v2_2;
-    EXPECT_FLOAT_EQ(v2_1.X, -2.0f);
-    EXPECT_FLOAT_EQ(v2_1.Y, -2.0f);
-}
-
-TEST(Subtraction, Vec3)
-{
-    hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
-
-    {
-        hmm_vec3 result = HMM_SubtractVec3(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, -3.0f);
-        EXPECT_FLOAT_EQ(result.Y, -3.0f);
-        EXPECT_FLOAT_EQ(result.Z, -3.0f);
-    }
-    {
-        hmm_vec3 result = HMM_Subtract(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, -3.0f);
-        EXPECT_FLOAT_EQ(result.Y, -3.0f);
-        EXPECT_FLOAT_EQ(result.Z, -3.0f);
-    }
-    {
-        hmm_vec3 result = v3_1 - v3_2;
-        EXPECT_FLOAT_EQ(result.X, -3.0f);
-        EXPECT_FLOAT_EQ(result.Y, -3.0f);
-        EXPECT_FLOAT_EQ(result.Z, -3.0f);
-    }
-
-    v3_1 -= v3_2;
-    EXPECT_FLOAT_EQ(v3_1.X, -3.0f);
-    EXPECT_FLOAT_EQ(v3_1.Y, -3.0f);
-    EXPECT_FLOAT_EQ(v3_1.Z, -3.0f);
-}
-
-TEST(Subtraction, Vec4)
-{
-    hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        hmm_vec4 result = HMM_SubtractVec4(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-    {
-        hmm_vec4 result = HMM_Subtract(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-    {
-        hmm_vec4 result = v4_1 - v4_2;
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-
-    v4_1 -= v4_2;
-    EXPECT_FLOAT_EQ(v4_1.X, -4.0f);
-    EXPECT_FLOAT_EQ(v4_1.Y, -4.0f);
-    EXPECT_FLOAT_EQ(v4_1.Z, -4.0f);
-    EXPECT_FLOAT_EQ(v4_1.W, -4.0f);
-}
-
-TEST(Subtraction, Mat4)
-{
-    hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
-    hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
-
-    // Fill the matrices
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_1.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_2.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_mat4 result = HMM_SubtractMat4(m4_1, m4_2);
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
-            }
-        }
-    }
-    {
-        hmm_mat4 result = HMM_Subtract(m4_1, m4_2);
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
-            }
-        }
-    }
-    {
-        hmm_mat4 result = m4_1 - m4_2;
-        for (int Column = 0; Column < 4; ++Column)
-        {
-            for (int Row = 0; Row < 4; ++Row)
-            {
-                EXPECT_FLOAT_EQ(result.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
-            }
-        }
-    }
-
-    m4_1 -= m4_2;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            EXPECT_FLOAT_EQ(m4_1.Elements[Column][Row], -16.0f) << "At column " << Column << ", row " << Row;
-        }
-    }
-}
-
-TEST(Subtraction, Quaternion)
-{
-    hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        hmm_quaternion result = HMM_SubtractQuaternion(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-    {
-        hmm_quaternion result = HMM_Subtract(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-    {
-        hmm_quaternion result = q1 - q2;
-        EXPECT_FLOAT_EQ(result.X, -4.0f);
-        EXPECT_FLOAT_EQ(result.Y, -4.0f);
-        EXPECT_FLOAT_EQ(result.Z, -4.0f);
-        EXPECT_FLOAT_EQ(result.W, -4.0f);
-    }
-
-    q1 -= q2;
-    EXPECT_FLOAT_EQ(q1.X, -4.0f);
-    EXPECT_FLOAT_EQ(q1.Y, -4.0f);
-    EXPECT_FLOAT_EQ(q1.Z, -4.0f);
-    EXPECT_FLOAT_EQ(q1.W, -4.0f);
-}
-
-TEST(Multiplication, Vec2Vec2)
-{
-    hmm_vec2 v2_1 = HMM_Vec2(1.0f, 2.0f);
-    hmm_vec2 v2_2 = HMM_Vec2(3.0f, 4.0f);
-
-    {
-        hmm_vec2 result = HMM_MultiplyVec2(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-    }
-    {
-        hmm_vec2 result = HMM_Multiply(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-    }
-    {
-        hmm_vec2 result = v2_1 * v2_2;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 8.0f);
-    }
-
-    v2_1 *= v2_2;
-    EXPECT_FLOAT_EQ(v2_1.X, 3.0f);
-    EXPECT_FLOAT_EQ(v2_1.Y, 8.0f);
-}
-
-TEST(Multiplication, Vec2Scalar)
-{
-    hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
-    float s = 3.0f;
-
-    {
-        hmm_vec2 result = HMM_MultiplyVec2f(v2, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-    {
-        hmm_vec2 result = HMM_Multiply(v2, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-    {
-        hmm_vec2 result = v2 * s;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-    {
-        hmm_vec2 result = s * v2;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-    }
-
-    v2 *= s;
-    EXPECT_FLOAT_EQ(v2.X, 3.0f);
-    EXPECT_FLOAT_EQ(v2.Y, 6.0f);
-}
-
-TEST(Multiplication, Vec3Vec3)
-{
-    hmm_vec3 v3_1 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec3 v3_2 = HMM_Vec3(4.0f, 5.0f, 6.0f);
-
-    {
-        hmm_vec3 result = HMM_MultiplyVec3(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 10.0f);
-        EXPECT_FLOAT_EQ(result.Z, 18.0f);
-    }
-    {
-        hmm_vec3 result = HMM_Multiply(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 10.0f);
-        EXPECT_FLOAT_EQ(result.Z, 18.0f);
-    }
-    {
-        hmm_vec3 result = v3_1 * v3_2;
-        EXPECT_FLOAT_EQ(result.X, 4.0f);
-        EXPECT_FLOAT_EQ(result.Y, 10.0f);
-        EXPECT_FLOAT_EQ(result.Z, 18.0f);
-    }
-
-    v3_1 *= v3_2;
-    EXPECT_FLOAT_EQ(v3_1.X, 4.0f);
-    EXPECT_FLOAT_EQ(v3_1.Y, 10.0f);
-    EXPECT_FLOAT_EQ(v3_1.Z, 18.0f);
-}
-
-TEST(Multiplication, Vec3Scalar)
-{
-    hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    float s = 3.0f;
-
-    {
-        hmm_vec3 result = HMM_MultiplyVec3f(v3, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-    {
-        hmm_vec3 result = HMM_Multiply(v3, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-    {
-        hmm_vec3 result = v3 * s;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-    {
-        hmm_vec3 result = s * v3;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-    }
-
-    v3 *= s;
-    EXPECT_FLOAT_EQ(v3.X, 3.0f);
-    EXPECT_FLOAT_EQ(v3.Y, 6.0f);
-    EXPECT_FLOAT_EQ(v3.Z, 9.0f);
-}
-
-TEST(Multiplication, Vec4Vec4)
-{
-    hmm_vec4 v4_1 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_vec4 v4_2 = HMM_Vec4(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        hmm_vec4 result = HMM_MultiplyVec4(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 12.0f);
-        EXPECT_FLOAT_EQ(result.Z, 21.0f);
-        EXPECT_FLOAT_EQ(result.W, 32.0f);
-    }
-    {
-        hmm_vec4 result = HMM_Multiply(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 12.0f);
-        EXPECT_FLOAT_EQ(result.Z, 21.0f);
-        EXPECT_FLOAT_EQ(result.W, 32.0f);
-    }
-    {
-        hmm_vec4 result = v4_1 * v4_2;
-        EXPECT_FLOAT_EQ(result.X, 5.0f);
-        EXPECT_FLOAT_EQ(result.Y, 12.0f);
-        EXPECT_FLOAT_EQ(result.Z, 21.0f);
-        EXPECT_FLOAT_EQ(result.W, 32.0f);
-    }
-
-    v4_1 *= v4_2;
-    EXPECT_FLOAT_EQ(v4_1.X, 5.0f);
-    EXPECT_FLOAT_EQ(v4_1.Y, 12.0f);
-    EXPECT_FLOAT_EQ(v4_1.Z, 21.0f);
-    EXPECT_FLOAT_EQ(v4_1.W, 32.0f);
-}
-
-TEST(Multiplication, Vec4Scalar)
-{
-    hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    float s = 3.0f;
-
-    {
-        hmm_vec4 result = HMM_MultiplyVec4f(v4, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_vec4 result = HMM_Multiply(v4, s);
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_vec4 result = v4 * s;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-    {
-        hmm_vec4 result = s * v4;
-        EXPECT_FLOAT_EQ(result.X, 3.0f);
-        EXPECT_FLOAT_EQ(result.Y, 6.0f);
-        EXPECT_FLOAT_EQ(result.Z, 9.0f);
-        EXPECT_FLOAT_EQ(result.W, 12.0f);
-    }
-
-    v4 *= s;
-    EXPECT_FLOAT_EQ(v4.X, 3.0f);
-    EXPECT_FLOAT_EQ(v4.Y, 6.0f);
-    EXPECT_FLOAT_EQ(v4.Z, 9.0f);
-}
-
-TEST(Multiplication, Mat4Mat4)
-{
-    hmm_mat4 m4_1 = HMM_Mat4(); // will have 1 - 16
-    hmm_mat4 m4_2 = HMM_Mat4(); // will have 17 - 32
-
-    // Fill the matrices
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_1.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4_2.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_mat4 result = HMM_MultiplyMat4(m4_1, m4_2);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
-    }
-    {
-        hmm_mat4 result = HMM_Multiply(m4_1, m4_2);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
-    }
-    {
-        hmm_mat4 result = m4_1 * m4_2;
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 612.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 686.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 760.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 650.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 740.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 830.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 920.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 762.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 868.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 974.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 1080.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 874.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 996.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
-    }
-
-    // At the time I wrote this, I intentionally omitted
-    // the *= operator for matrices because matrix
-    // multiplication is not commutative. (bvisness)
-}
-
-TEST(Multiplication, Mat4Scalar)
-{
-    hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
-    float s = 3;
-
-    // Fill the matrix
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_mat4 result = HMM_MultiplyMat4f(m4, s);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
-    }
-    {
-        hmm_mat4 result = HMM_Multiply(m4, s);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
-    }
-    {
-        hmm_mat4 result = m4 * s;
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
-    }
-    {
-        hmm_mat4 result = s * m4;
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 9.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 12.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 15.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 18.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 24.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 27.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 30.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 33.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 36.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 39.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 42.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
-    }
-
-    m4 *= s;
-    EXPECT_FLOAT_EQ(m4.Elements[0][0], 3.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][1], 6.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][2], 9.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][3], 12.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][0], 15.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][1], 18.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][2], 21.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][3], 24.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][0], 27.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][1], 30.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][2], 33.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][3], 36.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][0], 39.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][1], 42.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][2], 45.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][3], 48.0f);
-}
-
-TEST(Multiplication, Mat4Vec4)
-{
-    hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
-    hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-
-    // Fill the matrix
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_vec4 result = HMM_MultiplyMat4ByVec4(m4, v4);
-        EXPECT_FLOAT_EQ(result.X, 90);
-        EXPECT_FLOAT_EQ(result.Y, 100);
-        EXPECT_FLOAT_EQ(result.Z, 110);
-        EXPECT_FLOAT_EQ(result.W, 120);
-    }
-    {
-        hmm_vec4 result = HMM_Multiply(m4, v4);
-        EXPECT_FLOAT_EQ(result.X, 90);
-        EXPECT_FLOAT_EQ(result.Y, 100);
-        EXPECT_FLOAT_EQ(result.Z, 110);
-        EXPECT_FLOAT_EQ(result.W, 120);
-    }
-    {
-        hmm_vec4 result = m4 * v4;
-        EXPECT_FLOAT_EQ(result.X, 90);
-        EXPECT_FLOAT_EQ(result.Y, 100);
-        EXPECT_FLOAT_EQ(result.Z, 110);
-        EXPECT_FLOAT_EQ(result.W, 120);
-    }
-
-    // *= makes no sense for this particular case.
-}
-
-TEST(Multiplication, QuaternionQuaternion)
-{
-    hmm_quaternion q1 = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    hmm_quaternion q2 = HMM_Quaternion(5.0f, 6.0f, 7.0f, 8.0f);
-
-    {
-        hmm_quaternion result = HMM_MultiplyQuaternion(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, 24.0f);
-        EXPECT_FLOAT_EQ(result.Y, 48.0f);
-        EXPECT_FLOAT_EQ(result.Z, 48.0f);
-        EXPECT_FLOAT_EQ(result.W, -6.0f);
-    }
-    {
-        hmm_quaternion result = HMM_Multiply(q1, q2);
-        EXPECT_FLOAT_EQ(result.X, 24.0f);
-        EXPECT_FLOAT_EQ(result.Y, 48.0f);
-        EXPECT_FLOAT_EQ(result.Z, 48.0f);
-        EXPECT_FLOAT_EQ(result.W, -6.0f);
-    }
-    {
-        hmm_quaternion result = q1 * q2;
-        EXPECT_FLOAT_EQ(result.X, 24.0f);
-        EXPECT_FLOAT_EQ(result.Y, 48.0f);
-        EXPECT_FLOAT_EQ(result.Z, 48.0f);
-        EXPECT_FLOAT_EQ(result.W, -6.0f);
-    }
-
-    // Like with matrices, we're not implementing the *=
-    // operator for quaternions because quaternion multiplication
-    // is not commutative.
-}
-
-TEST(Multiplication, QuaternionScalar)
-{
-    hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    float f = 2.0f;
-
-    {
-        hmm_quaternion result = HMM_MultiplyQuaternionF(q, f);
-        EXPECT_FLOAT_EQ(result.X, 2.0f);
-        EXPECT_FLOAT_EQ(result.Y, 4.0f);
-        EXPECT_FLOAT_EQ(result.Z, 6.0f);
-        EXPECT_FLOAT_EQ(result.W, 8.0f);
-    }
-    {
-        hmm_quaternion result = HMM_Multiply(q, f);
-        EXPECT_FLOAT_EQ(result.X, 2.0f);
-        EXPECT_FLOAT_EQ(result.Y, 4.0f);
-        EXPECT_FLOAT_EQ(result.Z, 6.0f);
-        EXPECT_FLOAT_EQ(result.W, 8.0f);
-    }
-    {
-        hmm_quaternion result = q * f;
-        EXPECT_FLOAT_EQ(result.X, 2.0f);
-        EXPECT_FLOAT_EQ(result.Y, 4.0f);
-        EXPECT_FLOAT_EQ(result.Z, 6.0f);
-        EXPECT_FLOAT_EQ(result.W, 8.0f);
-    }
-    {
-        hmm_quaternion result = f * q;
-        EXPECT_FLOAT_EQ(result.X, 2.0f);
-        EXPECT_FLOAT_EQ(result.Y, 4.0f);
-        EXPECT_FLOAT_EQ(result.Z, 6.0f);
-        EXPECT_FLOAT_EQ(result.W, 8.0f);
-    }
-
-    q *= f;
-    EXPECT_FLOAT_EQ(q.X, 2.0f);
-    EXPECT_FLOAT_EQ(q.Y, 4.0f);
-    EXPECT_FLOAT_EQ(q.Z, 6.0f);
-    EXPECT_FLOAT_EQ(q.W, 8.0f);
-}
-
-TEST(Division, Vec2Vec2)
-{
-    hmm_vec2 v2_1 = HMM_Vec2(1.0f, 3.0f);
-    hmm_vec2 v2_2 = HMM_Vec2(2.0f, 4.0f);
-
-    {
-        hmm_vec2 result = HMM_DivideVec2(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-    }
-    {
-        hmm_vec2 result = HMM_Divide(v2_1, v2_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-    }
-    {
-        hmm_vec2 result = v2_1 / v2_2;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-    }
-
-    v2_1 /= v2_2;
-    EXPECT_FLOAT_EQ(v2_1.X, 0.5f);
-    EXPECT_FLOAT_EQ(v2_1.Y, 0.75f);
-}
-
-TEST(Division, Vec2Scalar)
-{
-    hmm_vec2 v2 = HMM_Vec2(1.0f, 2.0f);
-    float s = 2;
-
-    {
-        hmm_vec2 result = HMM_DivideVec2f(v2, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-    }
-    {
-        hmm_vec2 result = HMM_Divide(v2, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-    }
-    {
-        hmm_vec2 result = v2 / s;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-    }
-
-    v2 /= s;
-    EXPECT_FLOAT_EQ(v2.X, 0.5f);
-    EXPECT_FLOAT_EQ(v2.Y, 1.0f);
-}
-
-TEST(Division, Vec3Vec3)
-{
-    hmm_vec3 v3_1 = HMM_Vec3(1.0f, 3.0f, 5.0f);
-    hmm_vec3 v3_2 = HMM_Vec3(2.0f, 4.0f, 0.5f);
-
-    {
-        hmm_vec3 result = HMM_DivideVec3(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-    }
-    {
-        hmm_vec3 result = HMM_Divide(v3_1, v3_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-    }
-    {
-        hmm_vec3 result = v3_1 / v3_2;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-    }
-
-    v3_1 /= v3_2;
-    EXPECT_FLOAT_EQ(v3_1.X, 0.5f);
-    EXPECT_FLOAT_EQ(v3_1.Y, 0.75f);
-    EXPECT_FLOAT_EQ(v3_1.Z, 10.0f);
-}
-
-TEST(Division, Vec3Scalar)
-{
-    hmm_vec3 v3 = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    float s = 2;
-
-    {
-        hmm_vec3 result = HMM_DivideVec3f(v3, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-    }
-    {
-        hmm_vec3 result = HMM_Divide(v3, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-    }
-    {
-        hmm_vec3 result = v3 / s;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-    }
-
-    v3 /= s;
-    EXPECT_FLOAT_EQ(v3.X, 0.5f);
-    EXPECT_FLOAT_EQ(v3.Y, 1.0f);
-    EXPECT_FLOAT_EQ(v3.Z, 1.5f);
-}
-
-TEST(Division, Vec4Vec4)
-{
-    hmm_vec4 v4_1 = HMM_Vec4(1.0f, 3.0f, 5.0f, 1.0f);
-    hmm_vec4 v4_2 = HMM_Vec4(2.0f, 4.0f, 0.5f, 4.0f);
-
-    {
-        hmm_vec4 result = HMM_DivideVec4(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 0.25f);
-    }
-    {
-        hmm_vec4 result = HMM_Divide(v4_1, v4_2);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 0.25f);
-    }
-    {
-        hmm_vec4 result = v4_1 / v4_2;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 0.75f);
-        EXPECT_FLOAT_EQ(result.Z, 10.0f);
-        EXPECT_FLOAT_EQ(result.W, 0.25f);
-    }
-
-    v4_1 /= v4_2;
-    EXPECT_FLOAT_EQ(v4_1.X, 0.5f);
-    EXPECT_FLOAT_EQ(v4_1.Y, 0.75f);
-    EXPECT_FLOAT_EQ(v4_1.Z, 10.0f);
-    EXPECT_FLOAT_EQ(v4_1.W, 0.25f);
-}
-
-TEST(Division, Vec4Scalar)
-{
-    hmm_vec4 v4 = HMM_Vec4(1.0f, 2.0f, 3.0f, 4.0f);
-    float s = 2;
-
-    {
-        hmm_vec4 result = HMM_DivideVec4f(v4, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-    {
-        hmm_vec4 result = HMM_Divide(v4, s);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-    {
-        hmm_vec4 result = v4 / s;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-
-    v4 /= s;
-    EXPECT_FLOAT_EQ(v4.X, 0.5f);
-    EXPECT_FLOAT_EQ(v4.Y, 1.0f);
-    EXPECT_FLOAT_EQ(v4.Z, 1.5f);
-    EXPECT_FLOAT_EQ(v4.W, 2.0f);
-}
-
-TEST(Division, Mat4Scalar)
-{
-    hmm_mat4 m4 = HMM_Mat4(); // will have 1 - 16
-    float s = 2;
-
-    // Fill the matrix
-    int Counter = 1;
-    for (int Column = 0; Column < 4; ++Column)
-    {
-        for (int Row = 0; Row < 4; ++Row)
-        {
-            m4.Elements[Column][Row] = Counter;
-            ++Counter;
-        }
-    }
-
-    // Test the results
-    {
-        hmm_mat4 result = HMM_DivideMat4f(m4, s);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
-    }
-    {
-        hmm_mat4 result = HMM_Divide(m4, s);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
-    }
-    {
-        hmm_mat4 result = m4 / s;
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 1.0f);
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 1.5f);
-        EXPECT_FLOAT_EQ(result.Elements[0][3], 2.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 2.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 3.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 3.5f);
-        EXPECT_FLOAT_EQ(result.Elements[1][3], 4.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 4.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][1], 5.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 5.5f);
-        EXPECT_FLOAT_EQ(result.Elements[2][3], 6.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][0], 6.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][1], 7.0f);
-        EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
-        EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
-    }
-
-    m4 /= s;
-    EXPECT_FLOAT_EQ(m4.Elements[0][0], 0.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][1], 1.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][2], 1.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[0][3], 2.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][0], 2.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][1], 3.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][2], 3.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[1][3], 4.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][0], 4.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][1], 5.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][2], 5.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[2][3], 6.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][0], 6.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][1], 7.0f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][2], 7.5f);
-    EXPECT_FLOAT_EQ(m4.Elements[3][3], 8.0f);
-}
-
-TEST(Division, QuaternionScalar)
-{
-    hmm_quaternion q = HMM_Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
-    float f = 2.0f;
-
-    {
-        hmm_quaternion result = HMM_DivideQuaternionF(q, f);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-    {
-        hmm_quaternion result = HMM_Divide(q, f);
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-    {
-        hmm_quaternion result = q / f;
-        EXPECT_FLOAT_EQ(result.X, 0.5f);
-        EXPECT_FLOAT_EQ(result.Y, 1.0f);
-        EXPECT_FLOAT_EQ(result.Z, 1.5f);
-        EXPECT_FLOAT_EQ(result.W, 2.0f);
-    }
-
-    q /= f;
-    EXPECT_FLOAT_EQ(q.X, 0.5f);
-    EXPECT_FLOAT_EQ(q.Y, 1.0f);
-    EXPECT_FLOAT_EQ(q.Z, 1.5f);
-    EXPECT_FLOAT_EQ(q.W, 2.0f);
-}
-
-TEST(Projection, Orthographic)
-{
-    hmm_mat4 projection = HMM_Orthographic(-10.0f, 10.0f, -5.0f, 5.0f, 0.0f, -10.0f);
-
-    hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -5.0f);
-    hmm_vec4 projected = projection * HMM_Vec4v(original, 1);
-
-    EXPECT_FLOAT_EQ(projected.X, 0.5f);
-    EXPECT_FLOAT_EQ(projected.Y, 1.0f);
-    EXPECT_FLOAT_EQ(projected.Z, -2.0f);
-    EXPECT_FLOAT_EQ(projected.W, 1.0f);
-}
-
-TEST(Projection, Perspective)
-{
-    hmm_mat4 projection = HMM_Perspective(90.0f, 2.0f, 5.0f, 15.0f);
-
-    {
-        hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -15.0f);
-        hmm_vec4 projected = projection * HMM_Vec4v(original, 1);
-        EXPECT_FLOAT_EQ(projected.X, 5.0f);
-        EXPECT_FLOAT_EQ(projected.Y, 10.0f);
-        EXPECT_FLOAT_EQ(projected.Z, 15.0f);
-        EXPECT_FLOAT_EQ(projected.W, 15.0f);
-    }
-    {
-        hmm_vec3 original = HMM_Vec3(5.0f, 5.0f, -5.0f);
-        hmm_vec4 projected = projection * HMM_Vec4v(original, 1);
-        EXPECT_FLOAT_EQ(projected.X, 5.0f);
-        EXPECT_FLOAT_EQ(projected.Y, 10.0f);
-        EXPECT_FLOAT_EQ(projected.Z, -5.0f);
-        EXPECT_FLOAT_EQ(projected.W, 5.0f);
-    }
-}
-
-TEST(Transformations, Translate)
-{
-    hmm_mat4 translate = HMM_Translate(HMM_Vec3(1.0f, -3.0f, 6.0f));
-
-    hmm_vec3 original = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec4 translated = translate * HMM_Vec4v(original, 1);
-
-    EXPECT_FLOAT_EQ(translated.X, 2.0f);
-    EXPECT_FLOAT_EQ(translated.Y, -1.0f);
-    EXPECT_FLOAT_EQ(translated.Z, 9.0f);
-    EXPECT_FLOAT_EQ(translated.W, 1.0f);
-}
-
-TEST(Transformations, Rotate)
-{
-    hmm_vec3 original = HMM_Vec3(1.0f, 1.0f, 1.0f);
-
-    hmm_mat4 rotateX = HMM_Rotate(90, HMM_Vec3(1, 0, 0));
-    hmm_vec4 rotatedX = rotateX * HMM_Vec4v(original, 1);
-    EXPECT_FLOAT_EQ(rotatedX.X, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedX.Y, -1.0f);
-    EXPECT_FLOAT_EQ(rotatedX.Z, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedX.W, 1.0f);
-
-    hmm_mat4 rotateY = HMM_Rotate(90, HMM_Vec3(0, 1, 0));
-    hmm_vec4 rotatedY = rotateY * HMM_Vec4v(original, 1);
-    EXPECT_FLOAT_EQ(rotatedY.X, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedY.Y, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedY.Z, -1.0f);
-    EXPECT_FLOAT_EQ(rotatedY.W, 1.0f);
-
-    hmm_mat4 rotateZ = HMM_Rotate(90, HMM_Vec3(0, 0, 1));
-    hmm_vec4 rotatedZ = rotateZ * HMM_Vec4v(original, 1);
-    EXPECT_FLOAT_EQ(rotatedZ.X, -1.0f);
-    EXPECT_FLOAT_EQ(rotatedZ.Y, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedZ.Z, 1.0f);
-    EXPECT_FLOAT_EQ(rotatedZ.W, 1.0f);
-}
-
-TEST(Transformations, Scale)
-{
-    hmm_mat4 scale = HMM_Scale(HMM_Vec3(2.0f, -3.0f, 0.5f));
-
-    hmm_vec3 original = HMM_Vec3(1.0f, 2.0f, 3.0f);
-    hmm_vec4 scaled = scale * HMM_Vec4v(original, 1);
-
-    EXPECT_FLOAT_EQ(scaled.X, 2.0f);
-    EXPECT_FLOAT_EQ(scaled.Y, -6.0f);
-    EXPECT_FLOAT_EQ(scaled.Z, 1.5f);
-    EXPECT_FLOAT_EQ(scaled.W, 1.0f);
-}
+#include "hmm_test.c"
+// C++ compilers complain when compiling a .c file...