Jelajahi Sumber

table: let's write some tests

Michele Caini 1 tahun lalu
induk
melakukan
bf854b0b5f
1 mengubah file dengan 16 tambahan dan 2 penghapusan
  1. 16 2
      test/entt/entity/table.cpp

+ 16 - 2
test/entt/entity/table.cpp

@@ -1,6 +1,20 @@
+#include <memory>
+#include <tuple>
+#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <gtest/gtest.h>
+#include <entt/core/iterator.hpp>
 #include <entt/entity/table.hpp>
 #include <entt/entity/table.hpp>
+#include "../../common/linter.hpp"
+
+TEST(Table, Constructors) {
+    entt::table<int, char> table;
+
+    ASSERT_NO_THROW([[maybe_unused]] auto alloc = table.get_allocator());
+
+    table = entt::table<int, char>{std::allocator<void>{}};
+
+    ASSERT_NO_THROW([[maybe_unused]] auto alloc = table.get_allocator());
+}
 
 
-TEST(Table, Placeholder) {
-    [[maybe_unused]] entt::table<int, char> table{};
 }
 }