3 Commits 2835837be2 ... fb6ac9b462

Author SHA1 Message Date
  Kajetan Johannes Hammerle fb6ac9b462 Refactoring 10 months ago
  Kajetan Johannes Hammerle 4c0dccb8bb .h to .hpp 10 months ago
  Kajetan Johannes Hammerle aa67387e3e Split utility into more files 10 months ago
100 changed files with 385 additions and 403 deletions
  1. 3 3
      data/Array.hpp
  2. 5 8
      data/ArrayList.hpp
  3. 2 3
      data/BitArray.cpp
  4. 3 3
      data/BitArray.hpp
  5. 3 3
      data/Components.hpp
  6. 5 6
      data/HashMap.hpp
  7. 3 3
      data/LinkedList.hpp
  8. 8 9
      data/List.hpp
  9. 9 12
      data/ProbingHashMap.hpp
  10. 5 8
      data/RingBuffer.hpp
  11. 4 4
      data/Stack.hpp
  12. 0 12
      io/File.h
  13. 12 0
      io/File.hpp
  14. 2 2
      io/FileReader.cpp
  15. 3 3
      io/FileReader.hpp
  16. 1 1
      math/Box.cpp
  17. 4 4
      math/Box.hpp
  18. 3 3
      math/BufferedValue.hpp
  19. 1 1
      math/Frustum.cpp
  20. 5 5
      math/Frustum.hpp
  21. 1 1
      math/Math.cpp
  22. 3 3
      math/Math.hpp
  23. 2 2
      math/Matrix.cpp
  24. 4 4
      math/Matrix.hpp
  25. 4 4
      math/MatrixStack.hpp
  26. 1 1
      math/Plane.cpp
  27. 4 4
      math/Plane.hpp
  28. 1 1
      math/Quaternion.cpp
  29. 4 4
      math/Quaternion.hpp
  30. 1 1
      math/Vector.cpp
  31. 4 4
      math/Vector.hpp
  32. 1 1
      math/View.cpp
  33. 3 3
      math/View.hpp
  34. 2 0
      meson.build
  35. 5 5
      performance/Main.cpp
  36. 32 32
      test/Main.cpp
  37. 2 2
      test/Test.cpp
  38. 5 5
      test/Test.hpp
  39. 3 3
      tests/ArrayListTests.cpp
  40. 0 8
      tests/ArrayListTests.h
  41. 8 0
      tests/ArrayListTests.hpp
  42. 4 4
      tests/ArrayStringTests.cpp
  43. 0 8
      tests/ArrayStringTests.h
  44. 8 0
      tests/ArrayStringTests.hpp
  45. 3 3
      tests/ArrayTests.cpp
  46. 0 8
      tests/ArrayTests.h
  47. 8 0
      tests/ArrayTests.hpp
  48. 3 3
      tests/BitArrayTests.cpp
  49. 0 8
      tests/BitArrayTests.h
  50. 8 0
      tests/BitArrayTests.hpp
  51. 3 3
      tests/BoxTests.cpp
  52. 0 8
      tests/BoxTests.h
  53. 8 0
      tests/BoxTests.hpp
  54. 3 3
      tests/BufferTests.cpp
  55. 0 8
      tests/BufferTests.h
  56. 8 0
      tests/BufferTests.hpp
  57. 4 4
      tests/BufferedValueTests.cpp
  58. 0 8
      tests/BufferedValueTests.h
  59. 8 0
      tests/BufferedValueTests.hpp
  60. 3 3
      tests/ClockTests.cpp
  61. 0 8
      tests/ClockTests.h
  62. 8 0
      tests/ClockTests.hpp
  63. 3 3
      tests/ColorTests.cpp
  64. 0 8
      tests/ColorTests.h
  65. 8 0
      tests/ColorTests.hpp
  66. 3 3
      tests/ComponentsTests.cpp
  67. 0 8
      tests/ComponentsTests.h
  68. 8 0
      tests/ComponentsTests.hpp
  69. 3 3
      tests/FileReaderTests.cpp
  70. 0 8
      tests/FileReaderTests.h
  71. 8 0
      tests/FileReaderTests.hpp
  72. 3 3
      tests/FrustumTests.cpp
  73. 0 8
      tests/FrustumTests.h
  74. 8 0
      tests/FrustumTests.hpp
  75. 3 3
      tests/HashMapTests.cpp
  76. 0 8
      tests/HashMapTests.h
  77. 8 0
      tests/HashMapTests.hpp
  78. 3 3
      tests/LinkedListTests.cpp
  79. 0 8
      tests/LinkedListTests.h
  80. 8 0
      tests/LinkedListTests.hpp
  81. 3 3
      tests/ListTests.cpp
  82. 0 8
      tests/ListTests.h
  83. 8 0
      tests/ListTests.hpp
  84. 3 3
      tests/MathTests.cpp
  85. 0 8
      tests/MathTests.h
  86. 8 0
      tests/MathTests.hpp
  87. 3 3
      tests/MatrixStackTests.cpp
  88. 0 8
      tests/MatrixStackTests.h
  89. 8 0
      tests/MatrixStackTests.hpp
  90. 3 3
      tests/MatrixTests.cpp
  91. 0 8
      tests/MatrixTests.h
  92. 8 0
      tests/MatrixTests.hpp
  93. 3 3
      tests/PlaneTests.cpp
  94. 0 8
      tests/PlaneTests.h
  95. 8 0
      tests/PlaneTests.hpp
  96. 3 3
      tests/ProbingHashMapTests.cpp
  97. 0 8
      tests/ProbingHashMapTests.h
  98. 8 0
      tests/ProbingHashMapTests.hpp
  99. 3 3
      tests/QuaternionTests.cpp
  100. 0 8
      tests/QuaternionTests.h

+ 3 - 3
data/Array.h → data/Array.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_ARRAY_H
-#define CORE_ARRAY_H
+#ifndef CORE_ARRAY_HPP
+#define CORE_ARRAY_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     template<typename T, int N>

+ 5 - 8
data/ArrayList.h → data/ArrayList.hpp

@@ -1,18 +1,15 @@
-#ifndef CORE_ARRAYLIST_H
-#define CORE_ARRAYLIST_H
+#ifndef CORE_ARRAYLIST_HPP
+#define CORE_ARRAYLIST_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/AlignedData.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     template<typename T, int N>
     class ArrayList final {
         static_assert(N > 0, "ArrayList size must be positive");
 
-        struct alignas(T) Aligned final {
-            char data[sizeof(T)];
-        };
-
-        Aligned data[static_cast<unsigned int>(N)];
+        AlignedType<T> data[static_cast<unsigned int>(N)];
         int length;
 
     public:

+ 2 - 3
data/BitArray.cpp

@@ -1,7 +1,6 @@
-#include "data/BitArray.h"
+#include "data/BitArray.hpp"
 
-#include "math/Math.h"
-#include "utils/Utility.h"
+#include "math/Math.hpp"
 
 static int roundUpDivide(int a, int b) {
     if(a % b == 0) {

+ 3 - 3
data/BitArray.h → data/BitArray.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_BIT_ARRAY_H
-#define CORE_BIT_ARRAY_H
+#ifndef CORE_BIT_ARRAY_HPP
+#define CORE_BIT_ARRAY_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     class BitArray final {

+ 3 - 3
data/Components.h → data/Components.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_COMPONENTS_H
-#define CORE_COMPONENTS_H
+#ifndef CORE_COMPONENTS_HPP
+#define CORE_COMPONENTS_HPP
 
-#include "data/HashMap.h"
+#include "data/HashMap.hpp"
 
 namespace Core {
     using Entity = int;

+ 5 - 6
data/HashMap.h → data/HashMap.hpp

@@ -1,10 +1,9 @@
-#ifndef CORE_HASHMAP_H
-#define CORE_HASHMAP_H
+#ifndef CORE_HPPASHMAP_HPP
+#define CORE_HPPASHMAP_HPP
 
-#include "data/LinkedList.h"
-#include "data/List.h"
-#include "utils/ArrayString.h"
-#include "utils/HashCode.h"
+#include "data/LinkedList.hpp"
+#include "data/List.hpp"
+#include "utils/HashCode.hpp"
 
 namespace Core {
     template<typename K, typename V>

+ 3 - 3
data/LinkedList.h → data/LinkedList.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_LINKED_LIST_H
-#define CORE_LINKED_LIST_H
+#ifndef CORE_LINKED_LIST_HPP
+#define CORE_LINKED_LIST_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     template<typename T>

+ 8 - 9
data/List.h → data/List.hpp

@@ -1,7 +1,9 @@
-#ifndef CORE_LIST_H
-#define CORE_LIST_H
+#ifndef CORE_LIST_HPP
+#define CORE_LIST_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/AlignedData.hpp"
+#include "utils/ArrayString.hpp"
+#include "utils/New.hpp"
 
 namespace Core {
     template<typename T>
@@ -22,7 +24,7 @@ namespace Core {
 
         ~List() {
             clear();
-            delete[] reinterpret_cast<Aligned*>(data);
+            delete[] reinterpret_cast<AlignedType<T>*>(data);
         }
 
         List& operator=(const List& other) = delete;
@@ -187,15 +189,12 @@ namespace Core {
         }
 
     private:
-        struct alignas(T) Aligned final {
-            char data[sizeof(T)];
-        };
-
         static Error allocate(T*& t, int n) {
             if(n <= 0) {
                 return Error::NEGATIVE_ARGUMENT;
             }
-            t = reinterpret_cast<T*>(new Aligned[static_cast<size_t>(n)]);
+            t = reinterpret_cast<T*>(
+                new AlignedType<T>[static_cast<size_t>(n)]);
             return t == nullptr ? Error::OUT_OF_MEMORY : Error::NONE;
         }
 

+ 9 - 12
data/ProbingHashMap.h → data/ProbingHashMap.hpp

@@ -1,10 +1,11 @@
-#ifndef CORE_PROBING_HASHMAP_H
-#define CORE_PROBING_HASHMAP_H
+#ifndef CORE_PROBING_HPPASHMAP_HPP
+#define CORE_PROBING_HPPASHMAP_HPP
 
-#include "data/List.h"
-#include "utils/ArrayString.h"
-#include "utils/HashCode.h"
-#include "utils/Logger.h"
+#include "data/List.hpp"
+#include "utils/AlignedData.hpp"
+#include "utils/ArrayString.hpp"
+#include "utils/HashCode.hpp"
+#include "utils/Logger.hpp"
 
 namespace Core {
     template<typename K, typename V>
@@ -119,10 +120,6 @@ namespace Core {
             IteratorAdapter<const ProbingHashMap, ConstKeyIterator>;
 
     private:
-        struct alignas(V) AlignedValue final {
-            char data[sizeof(V)];
-        };
-
         List<K> keys;
         V* values;
         int entries;
@@ -143,7 +140,7 @@ namespace Core {
                     values[i].~V();
                 }
             }
-            delete[] reinterpret_cast<AlignedValue*>(values);
+            delete[] reinterpret_cast<AlignedType<V>*>(values);
         }
 
         ProbingHashMap& operator=(const ProbingHashMap& other) = delete;
@@ -169,7 +166,7 @@ namespace Core {
             ProbingHashMap<K, V> map;
             int l = Core::Math::max(1 << Math::roundUpLog2(minCapacity), 8);
             CORE_RETURN_ERROR(map.keys.resize(l, emptyValue<K>()));
-            map.values = reinterpret_cast<V*>(new AlignedValue[l]);
+            map.values = reinterpret_cast<V*>(new AlignedType<V>[l]);
             if(map.values == nullptr) {
                 return Error::OUT_OF_MEMORY;
             }

+ 5 - 8
data/RingBuffer.h → data/RingBuffer.hpp

@@ -1,18 +1,15 @@
-#ifndef CORE_RINGBUFFER_H
-#define CORE_RINGBUFFER_H
+#ifndef CORE_RINGBUFFER_HPP
+#define CORE_RINGBUFFER_HPP
 
-#include "utils/ArrayString.h"
+#include "utils/AlignedData.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     template<typename T, int N>
     class RingBuffer final {
         static_assert(N > 0, "RingBuffer size must be positive");
 
-        struct alignas(T) Aligned final {
-            char data[sizeof(T)];
-        };
-
-        Aligned data[static_cast<unsigned int>(N)];
+        AlignedType<T> data[static_cast<unsigned int>(N)];
         int writeIndex;
         int readIndex;
         int values;

+ 4 - 4
data/Stack.h → data/Stack.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_STACK_H
-#define CORE_STACK_H
+#ifndef CORE_STACK_HPP
+#define CORE_STACK_HPP
 
-#include "data/ArrayList.h"
-#include "data/List.h"
+#include "data/ArrayList.hpp"
+#include "data/List.hpp"
 
 namespace Core {
     namespace Internal {

+ 0 - 12
io/File.h

@@ -1,12 +0,0 @@
-#ifndef CORE_FILE_H
-#define CORE_FILE_H
-
-#include <limits.h>
-
-#include "utils/ArrayString.h"
-
-namespace Core {
-    using Path = String8<PATH_MAX>;
-}
-
-#endif

+ 12 - 0
io/File.hpp

@@ -0,0 +1,12 @@
+#ifndef CORE_FILE_HPP
+#define CORE_FILE_HPP
+
+#include <limits.h>
+
+#include "utils/ArrayString.hpp"
+
+namespace Core {
+    using Path = String8<PATH_MAX>;
+}
+
+#endif

+ 2 - 2
io/FileReader.cpp

@@ -1,8 +1,8 @@
-#include "io/FileReader.h"
+#include "io/FileReader.hpp"
 
 #include <stdio.h>
 
-#include "utils/Logger.h"
+#include "utils/Logger.hpp"
 
 Core::FileReader::FileReader() : file(nullptr) {
 }

+ 3 - 3
io/FileReader.h → io/FileReader.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_FILE_READER_H
-#define CORE_FILE_READER_H
+#ifndef CORE_FILE_READER_HPP
+#define CORE_FILE_READER_HPP
 
-#include "io/File.h"
+#include "io/File.hpp"
 
 namespace Core {
     using Path = String8<PATH_MAX>;

+ 1 - 1
math/Box.cpp

@@ -1,4 +1,4 @@
-#include "math/Box.h"
+#include "math/Box.hpp"
 
 Core::Box::Box(const Vector3& min_, const Vector3& max_)
     : min(min_), max(max_) {

+ 4 - 4
math/Box.h → math/Box.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_BOX_H
-#define CORE_BOX_H
+#ifndef CORE_BOX_HPP
+#define CORE_BOX_HPP
 
-#include "math/Vector.h"
-#include "utils/ArrayString.h"
+#include "math/Vector.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     class Box final {

+ 3 - 3
math/BufferedValue.h → math/BufferedValue.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_BUFFERED_VALUE_H
-#define CORE_BUFFERED_VALUE_H
+#ifndef CORE_BUFFERED_VALUE_HPP
+#define CORE_BUFFERED_VALUE_HPP
 
-#include "math/Math.h"
+#include "math/Math.hpp"
 
 namespace Core {
     template<typename T>

+ 1 - 1
math/Frustum.cpp

@@ -1,4 +1,4 @@
-#include "math/Frustum.h"
+#include "math/Frustum.hpp"
 
 Core::Frustum::Frustum(float fieldOfView, float nearClip_, float farClip_)
     : tan(Core::Math::tan(Core::Math::degreeToRadian(fieldOfView) * 0.5f)),

+ 5 - 5
math/Frustum.h → math/Frustum.hpp

@@ -1,9 +1,9 @@
-#ifndef CORE_FRUSTUM_H
-#define CORE_FRUSTUM_H
+#ifndef CORE_FRUSTUM_HPP
+#define CORE_FRUSTUM_HPP
 
-#include "data/Array.h"
-#include "math/Matrix.h"
-#include "math/Plane.h"
+#include "data/Array.hpp"
+#include "math/Matrix.hpp"
+#include "math/Plane.hpp"
 
 namespace Core {
     class Frustum final {

+ 1 - 1
math/Math.cpp

@@ -1,4 +1,4 @@
-#include "math/Math.h"
+#include "math/Math.hpp"
 
 #include <math.h>
 

+ 3 - 3
math/Math.h → math/Math.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_MATH_H
-#define CORE_MATH_H
+#ifndef CORE_MATH_HPP
+#define CORE_MATH_HPP
 
-#include "utils/Utility.h"
+#include "utils/Meta.hpp"
 
 namespace Core::Math {
     template<typename T>

+ 2 - 2
math/Matrix.cpp

@@ -1,6 +1,6 @@
-#include "math/Matrix.h"
+#include "math/Matrix.hpp"
 
-#include "math/Math.h"
+#include "math/Math.hpp"
 
 Core::Matrix::Matrix() {
     unit();

+ 4 - 4
math/Matrix.h → math/Matrix.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_MATRIX_H
-#define CORE_MATRIX_H
+#ifndef CORE_MATRIX_HPP
+#define CORE_MATRIX_HPP
 
-#include "math/Quaternion.h"
-#include "utils/ArrayString.h"
+#include "math/Quaternion.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     class Matrix final {

+ 4 - 4
math/MatrixStack.h → math/MatrixStack.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_MATRIX_STACK_H
-#define CORE_MATRIX_STACK_H
+#ifndef CORE_MATRIX_STACK_HPP
+#define CORE_MATRIX_STACK_HPP
 
-#include "data/ArrayList.h"
-#include "math/Matrix.h"
+#include "data/ArrayList.hpp"
+#include "math/Matrix.hpp"
 
 namespace Core {
     template<int N>

+ 1 - 1
math/Plane.cpp

@@ -1,4 +1,4 @@
-#include "math/Plane.h"
+#include "math/Plane.hpp"
 
 Core::Plane::Plane() : d(0) {
 }

+ 4 - 4
math/Plane.h → math/Plane.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_PLANE_H
-#define CORE_PLANE_H
+#ifndef CORE_PLANE_HPP
+#define CORE_PLANE_HPP
 
-#include "math/Vector.h"
-#include "utils/ArrayString.h"
+#include "math/Vector.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     class Plane final {

+ 1 - 1
math/Quaternion.cpp

@@ -1,4 +1,4 @@
-#include "math/Quaternion.h"
+#include "math/Quaternion.hpp"
 
 Core::Quaternion::Quaternion() : w(1.0f) {
 }

+ 4 - 4
math/Quaternion.h → math/Quaternion.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_QUATERNION_H
-#define CORE_QUATERNION_H
+#ifndef CORE_QUATERNION_HPP
+#define CORE_QUATERNION_HPP
 
-#include "math/Vector.h"
-#include "utils/ArrayString.h"
+#include "math/Vector.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     class Quaternion final {

+ 1 - 1
math/Vector.cpp

@@ -1,4 +1,4 @@
-#include "math/Vector.h"
+#include "math/Vector.hpp"
 
 template<>
 Core::Vector3& Core::Vector3::setAngles(float lengthAngle, float widthAngle) {

+ 4 - 4
math/Vector.h → math/Vector.hpp

@@ -1,8 +1,8 @@
-#ifndef CORE_VECTOR_H
-#define CORE_VECTOR_H
+#ifndef CORE_VECTOR_HPP
+#define CORE_VECTOR_HPP
 
-#include "math/Math.h"
-#include "utils/ArrayString.h"
+#include "math/Math.hpp"
+#include "utils/ArrayString.hpp"
 
 namespace Core {
     template<int N, typename T>

+ 1 - 1
math/View.cpp

@@ -1,4 +1,4 @@
-#include "math/View.h"
+#include "math/View.hpp"
 
 void Core::View::updateDirections(float lengthAngle, float widthAngle) {
     back.setAngles(lengthAngle, widthAngle);

+ 3 - 3
math/View.h → math/View.hpp

@@ -1,7 +1,7 @@
-#ifndef CORE_VIEW_H
-#define CORE_VIEW_H
+#ifndef CORE_VIEW_HPP
+#define CORE_VIEW_HPP
 
-#include "math/Matrix.h"
+#include "math/Matrix.hpp"
 
 namespace Core {
     class View final {

+ 2 - 0
meson.build

@@ -3,6 +3,8 @@ project('core', 'cpp', default_options : ['cpp_std=c++2a'])
 src = [
     'utils/Logger.cpp',
     'utils/Utility.cpp',
+    'utils/Error.cpp',
+    'utils/New.cpp',
     'utils/Buffer.cpp',
     'utils/Clock.cpp',
     'utils/Random.cpp',

+ 5 - 5
performance/Main.cpp

@@ -1,8 +1,8 @@
-#include "data/HashMap.h"
-#include "data/ProbingHashMap.h"
-#include "test/Test.h"
-#include "utils/Clock.h"
-#include "utils/Random.h"
+#include "data/HashMap.hpp"
+#include "data/ProbingHashMap.hpp"
+#include "test/Test.hpp"
+#include "utils/Clock.hpp"
+#include "utils/Random.hpp"
 
 using Millis = Core::Clock::Nanos;
 

+ 32 - 32
test/Main.cpp

@@ -1,35 +1,35 @@
-#include "test/Test.h"
-#include "tests/ArrayListTests.h"
-#include "tests/ArrayStringTests.h"
-#include "tests/ArrayTests.h"
-#include "tests/BitArrayTests.h"
-#include "tests/BoxTests.h"
-#include "tests/BufferTests.h"
-#include "tests/BufferedValueTests.h"
-#include "tests/ClockTests.h"
-#include "tests/ColorTests.h"
-#include "tests/ComponentsTests.h"
-#include "tests/FileReaderTests.h"
-#include "tests/FrustumTests.h"
-#include "tests/HashMapTests.h"
-#include "tests/LinkedListTests.h"
-#include "tests/ListTests.h"
-#include "tests/MathTests.h"
-#include "tests/MatrixStackTests.h"
-#include "tests/MatrixTests.h"
-#include "tests/PlaneTests.h"
-#include "tests/ProbingHashMapTests.h"
-#include "tests/QuaternionTests.h"
-#include "tests/RandomTests.h"
-#include "tests/RingBufferTests.h"
-#include "tests/StackTests.h"
-#include "tests/ThreadTests.h"
-#include "tests/UniquePointerTests.h"
-#include "tests/UtilityTests.h"
-#include "tests/VectorTests.h"
-#include "tests/ViewTests.h"
-#include "utils/ArrayString.h"
-#include "utils/Utility.h"
+#include "test/Test.hpp"
+#include "tests/ArrayListTests.hpp"
+#include "tests/ArrayStringTests.hpp"
+#include "tests/ArrayTests.hpp"
+#include "tests/BitArrayTests.hpp"
+#include "tests/BoxTests.hpp"
+#include "tests/BufferTests.hpp"
+#include "tests/BufferedValueTests.hpp"
+#include "tests/ClockTests.hpp"
+#include "tests/ColorTests.hpp"
+#include "tests/ComponentsTests.hpp"
+#include "tests/FileReaderTests.hpp"
+#include "tests/FrustumTests.hpp"
+#include "tests/HashMapTests.hpp"
+#include "tests/LinkedListTests.hpp"
+#include "tests/ListTests.hpp"
+#include "tests/MathTests.hpp"
+#include "tests/MatrixStackTests.hpp"
+#include "tests/MatrixTests.hpp"
+#include "tests/PlaneTests.hpp"
+#include "tests/ProbingHashMapTests.hpp"
+#include "tests/QuaternionTests.hpp"
+#include "tests/RandomTests.hpp"
+#include "tests/RingBufferTests.hpp"
+#include "tests/StackTests.hpp"
+#include "tests/ThreadTests.hpp"
+#include "tests/UniquePointerTests.hpp"
+#include "tests/UtilityTests.hpp"
+#include "tests/VectorTests.hpp"
+#include "tests/ViewTests.hpp"
+#include "utils/ArrayString.hpp"
+#include "utils/Utility.hpp"
 
 static void onExit(int code, void* data) {
     unsigned int i = *static_cast<unsigned int*>(data);

+ 2 - 2
test/Test.cpp

@@ -1,10 +1,10 @@
-#include "test/Test.h"
+#include "test/Test.hpp"
 
 Core::HashMap<Core::Test::Internal::FileName, Core::Test::Internal::Result>
     Core::Test::Internal::results;
 
 void Core::Test::Internal::warn(const char* file, int line, Error e) {
-    CORE_LOG_WARNING("#:# | ", Core::getFileName(file), line, e);
+    CORE_LOG_WARNING("#:# | #", Core::Logger::getFileName(file), line, e);
 }
 
 bool Core::Test::Internal::checkFloat(const char* file, int line, float wanted,

+ 5 - 5
test/Test.h → test/Test.hpp

@@ -1,9 +1,9 @@
-#ifndef CORE_TEST_H
-#define CORE_TEST_H
+#ifndef CORE_TEST_HPP
+#define CORE_TEST_HPP
 
-#include "data/HashMap.h"
-#include "math/Vector.h"
-#include "utils/Logger.h"
+#include "data/HashMap.hpp"
+#include "math/Vector.hpp"
+#include "utils/Logger.hpp"
 
 namespace Core::Test {
     namespace Internal {

+ 3 - 3
tests/ArrayListTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ArrayListTests.h"
+#include "tests/ArrayListTests.hpp"
 
-#include "data/ArrayList.h"
-#include "test/Test.h"
+#include "data/ArrayList.hpp"
+#include "test/Test.hpp"
 
 using IntList = Core::ArrayList<int, 20>;
 

+ 0 - 8
tests/ArrayListTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_ARRAY_LIST_TESTS_H
-#define CORE_ARRAY_LIST_TESTS_H
-
-namespace Core::ArrayListTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ArrayListTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_ARRAY_LIST_TESTS_HPP
+#define CORE_ARRAY_LIST_TESTS_HPP
+
+namespace Core::ArrayListTests {
+    void test();
+}
+
+#endif

+ 4 - 4
tests/ArrayStringTests.cpp

@@ -1,8 +1,8 @@
-#include "tests/ArrayStringTests.h"
+#include "tests/ArrayStringTests.hpp"
 
-#include "data/HashMap.h"
-#include "test/Test.h"
-#include "utils/ArrayString.h"
+#include "data/HashMap.hpp"
+#include "test/Test.hpp"
+#include "utils/ArrayString.hpp"
 
 using String8 = Core::String8<128>;
 using String32 = Core::String32<128>;

+ 0 - 8
tests/ArrayStringTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_ARRAY_STRING_TESTS_H
-#define CORE_ARRAY_STRING_TESTS_H
-
-namespace Core::ArrayStringTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ArrayStringTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_ARRAY_STRING_TESTS_HPP
+#define CORE_ARRAY_STRING_TESTS_HPP
+
+namespace Core::ArrayStringTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ArrayTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ArrayTests.h"
+#include "tests/ArrayTests.hpp"
 
-#include "data/Array.h"
-#include "test/Test.h"
+#include "data/Array.hpp"
+#include "test/Test.hpp"
 
 static void testToString1() {
     Core::Array<int, 3> a;

+ 0 - 8
tests/ArrayTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_ARRAY_TESTS_H
-#define CORE_ARRAY_TESTS_H
-
-namespace Core::ArrayTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ArrayTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_ARRAY_TESTS_HPP
+#define CORE_ARRAY_TESTS_HPP
+
+namespace Core::ArrayTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/BitArrayTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/BitArrayTests.h"
+#include "tests/BitArrayTests.hpp"
 
-#include "data/BitArray.h"
-#include "test/Test.h"
+#include "data/BitArray.hpp"
+#include "test/Test.hpp"
 
 static void testSetRead() {
     Core::BitArray bits;

+ 0 - 8
tests/BitArrayTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_BIT_ARRAY_TESTS_H
-#define CORE_BIT_ARRAY_TESTS_H
-
-namespace Core::BitArrayTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/BitArrayTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_BIT_ARRAY_TESTS_HPP
+#define CORE_BIT_ARRAY_TESTS_HPP
+
+namespace Core::BitArrayTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/BoxTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/BoxTests.h"
+#include "tests/BoxTests.hpp"
 
-#include "math/Box.h"
-#include "test/Test.h"
+#include "math/Box.hpp"
+#include "test/Test.hpp"
 
 static void testInit() {
     Core::Box box(Core::Vector3(1.0f, 2.0f, 3.0f));

+ 0 - 8
tests/BoxTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_BOX_TESTS_H
-#define CORE_BOX_TESTS_H
-
-namespace Core::BoxTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/BoxTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_BOX_TESTS_HPP
+#define CORE_BOX_TESTS_HPP
+
+namespace Core::BoxTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/BufferTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/BufferTests.h"
+#include "tests/BufferTests.hpp"
 
-#include "test/Test.h"
-#include "utils/Buffer.h"
+#include "test/Test.hpp"
+#include "utils/Buffer.hpp"
 
 static constexpr int SIZE_TYPES =
     sizeof(int) + sizeof(long) + sizeof(float) + sizeof(double);

+ 0 - 8
tests/BufferTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_BUFFER_TESTS_H
-#define CORE_BUFFER_TESTS_H
-
-namespace Core::BufferTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/BufferTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_BUFFER_TESTS_HPP
+#define CORE_BUFFER_TESTS_HPP
+
+namespace Core::BufferTests {
+    void test();
+}
+
+#endif

+ 4 - 4
tests/BufferedValueTests.cpp

@@ -1,8 +1,8 @@
-#include "tests/BufferedValueTests.h"
+#include "tests/BufferedValueTests.hpp"
 
-#include "math/BufferedValue.h"
-#include "math/Vector.h"
-#include "test/Test.h"
+#include "math/BufferedValue.hpp"
+#include "math/Vector.hpp"
+#include "test/Test.hpp"
 
 const float eps = 0.0001f;
 

+ 0 - 8
tests/BufferedValueTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_BUFFERED_VALUE_TESTS_H
-#define CORE_BUFFERED_VALUE_TESTS_H
-
-namespace Core::BufferedValueTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/BufferedValueTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_BUFFERED_VALUE_TESTS_HPP
+#define CORE_BUFFERED_VALUE_TESTS_HPP
+
+namespace Core::BufferedValueTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ClockTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ClockTests.h"
+#include "tests/ClockTests.hpp"
 
-#include "test/Test.h"
-#include "utils/Clock.h"
+#include "test/Test.hpp"
+#include "utils/Clock.hpp"
 
 static void testUpdate() {
     Core::Clock c;

+ 0 - 8
tests/ClockTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_CLOCK_TESTS_H
-#define CORE_CLOCK_TESTS_H
-
-namespace Core::ClockTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ClockTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_CLOCK_TESTS_HPP
+#define CORE_CLOCK_TESTS_HPP
+
+namespace Core::ClockTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ColorTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ColorTests.h"
+#include "tests/ColorTests.hpp"
 
-#include "test/Test.h"
-#include "utils/Color.h"
+#include "test/Test.hpp"
+#include "utils/Color.hpp"
 
 const float eps = 0.0001f;
 

+ 0 - 8
tests/ColorTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_COLOR_TESTS_H
-#define CORE_COLOR_TESTS_H
-
-namespace Core::ColorTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ColorTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_COLOR_TESTS_HPP
+#define CORE_COLOR_TESTS_HPP
+
+namespace Core::ColorTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ComponentsTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ComponentsTests.h"
+#include "tests/ComponentsTests.hpp"
 
-#include "data/Components.h"
-#include "test/Test.h"
+#include "data/Components.hpp"
+#include "test/Test.hpp"
 
 using IntComponent = Core::Components<int>;
 

+ 0 - 8
tests/ComponentsTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_COMPONENTS_TESTS_H
-#define CORE_COMPONENTS_TESTS_H
-
-namespace Core::ComponentsTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ComponentsTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_COMPONENTS_TESTS_HPP
+#define CORE_COMPONENTS_TESTS_HPP
+
+namespace Core::ComponentsTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/FileReaderTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/FileReaderTests.h"
+#include "tests/FileReaderTests.hpp"
 
-#include "io/FileReader.h"
-#include "test/Test.h"
+#include "io/FileReader.hpp"
+#include "test/Test.hpp"
 
 static constexpr const char* TEST_FILE = "../src/tests/resources/test";
 

+ 0 - 8
tests/FileReaderTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_FILE_READER_TESTS_H
-#define CORE_FILE_READER_TESTS_H
-
-namespace Core::FileReaderTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/FileReaderTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_FILE_READER_TESTS_HPP
+#define CORE_FILE_READER_TESTS_HPP
+
+namespace Core::FileReaderTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/FrustumTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/FrustumTests.h"
+#include "tests/FrustumTests.hpp"
 
-#include "math/Frustum.h"
-#include "test/Test.h"
+#include "math/Frustum.hpp"
+#include "test/Test.hpp"
 
 using V3 = Core::Vector3;
 

+ 0 - 8
tests/FrustumTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_FRUSTUM_TESTS_H
-#define CORE_FRUSTUM_TESTS_H
-
-namespace Core::FrustumTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/FrustumTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_FRUSTUM_TESTS_HPP
+#define CORE_FRUSTUM_TESTS_HPP
+
+namespace Core::FrustumTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/HashMapTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/HashMapTests.h"
+#include "tests/HashMapTests.hpp"
 
-#include "data/HashMap.h"
-#include "test/Test.h"
+#include "data/HashMap.hpp"
+#include "test/Test.hpp"
 
 using IntMap = Core::HashMap<int, int>;
 

+ 0 - 8
tests/HashMapTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_HASHMAP_TESTS_H
-#define CORE_HASHMAP_TESTS_H
-
-namespace Core::HashMapTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/HashMapTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_HPPASHMAP_TESTS_HPP
+#define CORE_HPPASHMAP_TESTS_HPP
+
+namespace Core::HashMapTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/LinkedListTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/LinkedListTests.h"
+#include "tests/LinkedListTests.hpp"
 
-#include "data/LinkedList.h"
-#include "test/Test.h"
+#include "data/LinkedList.hpp"
+#include "test/Test.hpp"
 
 struct LinkedListTester final {
     int a;

+ 0 - 8
tests/LinkedListTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_LINKED_LIST_TESTS_H
-#define CORE_LINKED_LIST_TESTS_H
-
-namespace Core::LinkedListTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/LinkedListTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_LINKED_LIST_TESTS_HPP
+#define CORE_LINKED_LIST_TESTS_HPP
+
+namespace Core::LinkedListTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ListTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/ListTests.h"
+#include "tests/ListTests.hpp"
 
-#include "data/List.h"
-#include "test/Test.h"
+#include "data/List.hpp"
+#include "test/Test.hpp"
 
 using IntList = Core::List<int>;
 

+ 0 - 8
tests/ListTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_LIST_TESTS_H
-#define CORE_LIST_TESTS_H
-
-namespace Core::ListTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ListTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_LIST_TESTS_HPP
+#define CORE_LIST_TESTS_HPP
+
+namespace Core::ListTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/MathTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/MathTests.h"
+#include "tests/MathTests.hpp"
 
-#include "math/Math.h"
-#include "test/Test.h"
+#include "math/Math.hpp"
+#include "test/Test.hpp"
 
 constexpr float eps = 0.0001f;
 

+ 0 - 8
tests/MathTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_MATH_TESTS_H
-#define CORE_MATH_TESTS_H
-
-namespace Core::MathTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/MathTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_MATH_TESTS_HPP
+#define CORE_MATH_TESTS_HPP
+
+namespace Core::MathTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/MatrixStackTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/MatrixStackTests.h"
+#include "tests/MatrixStackTests.hpp"
 
-#include "math/MatrixStack.h"
-#include "test/Test.h"
+#include "math/MatrixStack.hpp"
+#include "test/Test.hpp"
 
 using Matrices = Core::MatrixStack<5>;
 

+ 0 - 8
tests/MatrixStackTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_MATRIX_STACK_TESTS_H
-#define CORE_MATRIX_STACK_TESTS_H
-
-namespace Core::MatrixStackTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/MatrixStackTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_MATRIX_STACK_TESTS_HPP
+#define CORE_MATRIX_STACK_TESTS_HPP
+
+namespace Core::MatrixStackTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/MatrixTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/MatrixTests.h"
+#include "tests/MatrixTests.hpp"
 
-#include "math/Matrix.h"
-#include "test/Test.h"
+#include "math/Matrix.hpp"
+#include "test/Test.hpp"
 
 using V3 = Core::Vector3;
 

+ 0 - 8
tests/MatrixTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_MATRIX_TESTS_H
-#define CORE_MATRIX_TESTS_H
-
-namespace Core::MatrixTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/MatrixTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_MATRIX_TESTS_HPP
+#define CORE_MATRIX_TESTS_HPP
+
+namespace Core::MatrixTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/PlaneTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/PlaneTests.h"
+#include "tests/PlaneTests.hpp"
 
-#include "math/Plane.h"
-#include "test/Test.h"
+#include "math/Plane.hpp"
+#include "test/Test.hpp"
 
 const float eps = 0.0001f;
 

+ 0 - 8
tests/PlaneTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_PLANE_TESTS_H
-#define CORE_PLANE_TESTS_H
-
-namespace Core::PlaneTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/PlaneTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_PLANE_TESTS_HPP
+#define CORE_PLANE_TESTS_HPP
+
+namespace Core::PlaneTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/ProbingHashMapTests.cpp

@@ -1,9 +1,9 @@
-#include "tests/ProbingHashMapTests.h"
+#include "tests/ProbingHashMapTests.hpp"
 
 #include <stdio.h>
 
-#include "data/ProbingHashMap.h"
-#include "test/Test.h"
+#include "data/ProbingHashMap.hpp"
+#include "test/Test.hpp"
 
 using IntMap = Core::ProbingHashMap<int, int>;
 

+ 0 - 8
tests/ProbingHashMapTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_PROBING_HASHMAP_TESTS_H
-#define CORE_PROBING_HASHMAP_TESTS_H
-
-namespace Core::ProbingHashMapTests {
-    void test();
-}
-
-#endif

+ 8 - 0
tests/ProbingHashMapTests.hpp

@@ -0,0 +1,8 @@
+#ifndef CORE_PROBING_HPPASHMAP_TESTS_HPP
+#define CORE_PROBING_HPPASHMAP_TESTS_HPP
+
+namespace Core::ProbingHashMapTests {
+    void test();
+}
+
+#endif

+ 3 - 3
tests/QuaternionTests.cpp

@@ -1,7 +1,7 @@
-#include "tests/QuaternionTests.h"
+#include "tests/QuaternionTests.hpp"
 
-#include "math/Quaternion.h"
-#include "test/Test.h"
+#include "math/Quaternion.hpp"
+#include "test/Test.hpp"
 
 using V3 = Core::Vector3;
 

+ 0 - 8
tests/QuaternionTests.h

@@ -1,8 +0,0 @@
-#ifndef CORE_QUATERNION_TESTS_H
-#define CORE_QUATERNION_TESTS_H
-
-namespace Core::QuaternionTests {
-    void test();
-}
-
-#endif

Some files were not shown because too many files changed in this diff