Browse Source

test: fixed includes (while trying iwyu)

Michele Caini 4 years ago
parent
commit
922bfbf724
58 changed files with 100 additions and 39 deletions
  1. 3 3
      test/benchmark/benchmark.cpp
  2. 2 1
      test/entt/container/dense_map.cpp
  3. 2 1
      test/entt/container/dense_set.cpp
  4. 1 0
      test/entt/core/algorithm.cpp
  5. 7 3
      test/entt/core/any.cpp
  6. 1 0
      test/entt/core/compressed_pair.cpp
  7. 2 2
      test/entt/core/enum.cpp
  8. 1 0
      test/entt/core/hashed_string.cpp
  9. 1 0
      test/entt/core/iterator.cpp
  10. 3 0
      test/entt/core/memory.cpp
  11. 2 1
      test/entt/core/type_info.cpp
  12. 1 2
      test/entt/core/type_traits.cpp
  13. 0 2
      test/entt/entity/entity.cpp
  14. 3 0
      test/entt/entity/group.cpp
  15. 1 0
      test/entt/entity/handle.cpp
  16. 0 1
      test/entt/entity/helper.cpp
  17. 1 3
      test/entt/entity/observer.cpp
  18. 1 0
      test/entt/entity/organizer.cpp
  19. 4 1
      test/entt/entity/registry.cpp
  20. 2 0
      test/entt/entity/registry_no_eto.cpp
  21. 2 2
      test/entt/entity/runtime_view.cpp
  22. 0 1
      test/entt/entity/sigh_storage_mixin.cpp
  23. 2 1
      test/entt/entity/snapshot.cpp
  24. 0 1
      test/entt/entity/sparse_set.cpp
  25. 3 1
      test/entt/entity/storage.cpp
  26. 1 0
      test/entt/entity/view.cpp
  27. 1 0
      test/entt/locator/locator.cpp
  28. 3 0
      test/entt/meta/meta_any.cpp
  29. 2 0
      test/entt/meta/meta_base.cpp
  30. 5 0
      test/entt/meta/meta_container.cpp
  31. 1 0
      test/entt/meta/meta_conv.cpp
  32. 1 0
      test/entt/meta/meta_ctor.cpp
  33. 3 0
      test/entt/meta/meta_data.cpp
  34. 1 0
      test/entt/meta/meta_dtor.cpp
  35. 2 0
      test/entt/meta/meta_func.cpp
  36. 1 1
      test/entt/meta/meta_handle.cpp
  37. 1 1
      test/entt/meta/meta_pointer.cpp
  38. 2 1
      test/entt/meta/meta_prop.cpp
  39. 1 0
      test/entt/meta/meta_range.cpp
  40. 4 0
      test/entt/meta/meta_type.cpp
  41. 3 1
      test/entt/meta/meta_utility.cpp
  42. 4 2
      test/entt/poly/poly.cpp
  43. 1 0
      test/entt/process/scheduler.cpp
  44. 5 0
      test/entt/resource/resource.cpp
  45. 1 0
      test/entt/signal/delegate.cpp
  46. 1 1
      test/entt/signal/dispatcher.cpp
  47. 0 1
      test/entt/signal/sigh.cpp
  48. 2 1
      test/example/custom_identifier.cpp
  49. 1 1
      test/example/entity_copy.cpp
  50. 1 0
      test/lib/dispatcher/main.cpp
  51. 1 0
      test/lib/dispatcher_plugin/main.cpp
  52. 0 1
      test/lib/meta/lib.cpp
  53. 1 0
      test/lib/meta/main.cpp
  54. 1 0
      test/lib/meta_plugin/main.cpp
  55. 1 1
      test/lib/meta_plugin/plugin.cpp
  56. 1 0
      test/lib/meta_plugin_std/main.cpp
  57. 1 1
      test/lib/meta_plugin_std/plugin.cpp
  58. 1 0
      test/snapshot/snapshot.cpp

+ 3 - 3
test/benchmark/benchmark.cpp

@@ -1,8 +1,8 @@
 #include <chrono>
-#include <cstddef>
 #include <cstdint>
 #include <iostream>
-#include <iterator>
+#include <utility>
+#include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/type_info.hpp>
 #include <entt/entity/registry.hpp>
@@ -15,7 +15,7 @@ struct position {
 struct velocity: position {};
 struct stable_position: position {};
 
-template<std::size_t>
+template<auto>
 struct comp { int x; };
 
 template<>

+ 2 - 1
test/entt/container/dense_map.cpp

@@ -1,6 +1,7 @@
-#include <cmath>
+#include <cstddef>
 #include <functional>
 #include <iterator>
+#include <memory>
 #include <tuple>
 #include <type_traits>
 #include <utility>

+ 2 - 1
test/entt/container/dense_set.cpp

@@ -1,6 +1,7 @@
-#include <cmath>
+#include <cstddef>
 #include <functional>
 #include <iterator>
+#include <memory>
 #include <tuple>
 #include <type_traits>
 #include <utility>

+ 1 - 0
test/entt/core/algorithm.cpp

@@ -1,4 +1,5 @@
 #include <array>
+#include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/algorithm.hpp>
 

+ 7 - 3
test/entt/core/any.cpp

@@ -1,10 +1,14 @@
 #include <algorithm>
-#include <string>
+#include <cstdint>
+#include <cstring>
+#include <iterator>
 #include <type_traits>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/any.hpp>
+#include <entt/core/type_info.hpp>
 
 struct empty {
     ~empty() {
@@ -1434,11 +1438,11 @@ TEST_F(Any, DeducedArrayType) {
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.type(), entt::type_id<const char *>());
-    ASSERT_EQ((strcmp("array of char", entt::any_cast<const char *>(any))), 0);
+    ASSERT_EQ((std::strcmp("array of char", entt::any_cast<const char *>(any))), 0);
 
     any = "another array of char";
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.type(), entt::type_id<const char *>());
-    ASSERT_EQ((strcmp("another array of char", entt::any_cast<const char *>(any))), 0);
+    ASSERT_EQ((std::strcmp("another array of char", entt::any_cast<const char *>(any))), 0);
 }

+ 1 - 0
test/entt/core/compressed_pair.cpp

@@ -2,6 +2,7 @@
 #include <type_traits>
 #include <utility>
 #include <gtest/gtest.h>
+#include <entt/config/config.h>
 #include <entt/core/compressed_pair.hpp>
 
 struct empty_type {};

+ 2 - 2
test/entt/core/enum.cpp

@@ -1,7 +1,7 @@
-#include <cstddef>
+#include <cstdint>
+#include <type_traits>
 #include <gtest/gtest.h>
 #include <entt/core/enum.hpp>
-#include <entt/core/type_traits.hpp>
 
 enum class detected {
     foo = 0x01,

+ 1 - 0
test/entt/core/hashed_string.cpp

@@ -1,3 +1,4 @@
+#include <cstdint>
 #include <string>
 #include <string_view>
 #include <type_traits>

+ 1 - 0
test/entt/core/iterator.cpp

@@ -1,3 +1,4 @@
+#include <type_traits>
 #include <utility>
 #include <vector>
 #include <gtest/gtest.h>

+ 3 - 0
test/entt/core/memory.cpp

@@ -1,6 +1,9 @@
 #include <cmath>
+#include <cstddef>
 #include <limits>
 #include <memory>
+#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/memory.hpp>
 

+ 2 - 1
test/entt/core/type_info.cpp

@@ -1,7 +1,8 @@
 #include <string_view>
 #include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
-#include <entt/core/hashed_string.hpp>
+#include <entt/config/config.h>
 #include <entt/core/type_info.hpp>
 #include <entt/core/type_traits.hpp>
 

+ 1 - 2
test/entt/core/type_traits.cpp

@@ -1,11 +1,10 @@
 #include <functional>
-#include <iterator>
 #include <tuple>
 #include <type_traits>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 #include <gtest/gtest.h>
-#include <entt/config/config.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/core/type_traits.hpp>
 

+ 0 - 2
test/entt/entity/entity.cpp

@@ -1,5 +1,3 @@
-#include <functional>
-#include <type_traits>
 #include <gtest/gtest.h>
 #include <entt/entity/entity.hpp>
 #include <entt/entity/registry.hpp>

+ 3 - 0
test/entt/entity/group.cpp

@@ -1,5 +1,8 @@
 #include <algorithm>
+#include <cstddef>
+#include <functional>
 #include <iterator>
+#include <tuple>
 #include <type_traits>
 #include <utility>
 #include <gtest/gtest.h>

+ 1 - 0
test/entt/entity/handle.cpp

@@ -1,3 +1,4 @@
+#include <tuple>
 #include <type_traits>
 #include <utility>
 #include <gtest/gtest.h>

+ 0 - 1
test/entt/entity/helper.cpp

@@ -1,5 +1,4 @@
 #include <gtest/gtest.h>
-#include <entt/core/hashed_string.hpp>
 #include <entt/core/type_traits.hpp>
 #include <entt/entity/entity.hpp>
 #include <entt/entity/helper.hpp>

+ 1 - 3
test/entt/entity/observer.cpp

@@ -1,6 +1,4 @@
-#include <cstddef>
-#include <tuple>
-#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/entity/observer.hpp>
 #include <entt/entity/registry.hpp>

+ 1 - 0
test/entt/entity/organizer.cpp

@@ -1,3 +1,4 @@
+#include <cstddef>
 #include <gtest/gtest.h>
 #include <entt/entity/organizer.hpp>
 #include <entt/entity/registry.hpp>

+ 4 - 1
test/entt/entity/registry.cpp

@@ -1,10 +1,13 @@
-#include <cstdint>
+#include <cstddef>
 #include <functional>
 #include <iterator>
 #include <memory>
+#include <tuple>
 #include <type_traits>
 #include <unordered_set>
+#include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/core/type_traits.hpp>
 #include <entt/entity/component.hpp>
 #include <entt/entity/entity.hpp>

+ 2 - 0
test/entt/entity/registry_no_eto.cpp

@@ -1,3 +1,5 @@
+#include <tuple>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/entity/registry.hpp>
 

+ 2 - 2
test/entt/entity/runtime_view.cpp

@@ -1,7 +1,7 @@
 #include <algorithm>
-#include <iterator>
+#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
-#include <entt/core/type_info.hpp>
 #include <entt/entity/component.hpp>
 #include <entt/entity/registry.hpp>
 #include <entt/entity/runtime_view.hpp>

+ 0 - 1
test/entt/entity/sigh_storage_mixin.cpp

@@ -1,5 +1,4 @@
 #include <iterator>
-#include <type_traits>
 #include <gtest/gtest.h>
 #include <entt/entity/component.hpp>
 #include <entt/entity/registry.hpp>

+ 2 - 1
test/entt/entity/snapshot.cpp

@@ -1,3 +1,4 @@
+#include <cstddef>
 #include <map>
 #include <queue>
 #include <tuple>
@@ -308,7 +309,7 @@ TEST(Snapshot, Continuous) {
     });
 
     src.view<map_component>().each([&entities](auto, auto &map_component) {
-        for(size_t i = 0; i < entities.size(); ++i) {
+        for(std::size_t i = 0; i < entities.size(); ++i) {
             map_component.keys.insert({entities[i], int(i)});
             map_component.values.insert({int(i), entities[i]});
             map_component.both.insert({entities[entities.size() - i - 1], entities[i]});

+ 0 - 1
test/entt/entity/sparse_set.cpp

@@ -1,5 +1,4 @@
 #include <algorithm>
-#include <cstdint>
 #include <functional>
 #include <iterator>
 #include <type_traits>

+ 3 - 1
test/entt/entity/storage.cpp

@@ -1,6 +1,8 @@
-#include <exception>
+#include <algorithm>
+#include <cstddef>
 #include <iterator>
 #include <memory>
+#include <tuple>
 #include <type_traits>
 #include <unordered_set>
 #include <utility>

+ 1 - 0
test/entt/entity/view.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <iterator>
 #include <tuple>
 #include <type_traits>
 #include <utility>

+ 1 - 0
test/entt/locator/locator.cpp

@@ -1,3 +1,4 @@
+#include <memory>
 #include <gtest/gtest.h>
 #include <entt/locator/locator.hpp>
 

+ 3 - 0
test/entt/meta/meta_any.cpp

@@ -1,5 +1,8 @@
 #include <algorithm>
+#include <cstddef>
+#include <iterator>
 #include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>

+ 2 - 0
test/entt/meta/meta_base.cpp

@@ -1,4 +1,6 @@
+#include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/node.hpp>

+ 5 - 0
test/entt/meta/meta_container.cpp

@@ -1,3 +1,8 @@
+#include <array>
+#include <map>
+#include <set>
+#include <utility>
+#include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/container.hpp>

+ 1 - 0
test/entt/meta/meta_conv.cpp

@@ -1,5 +1,6 @@
 #include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/node.hpp>

+ 1 - 0
test/entt/meta/meta_ctor.cpp

@@ -1,3 +1,4 @@
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/core/utility.hpp>

+ 3 - 0
test/entt/meta/meta_data.cpp

@@ -1,9 +1,12 @@
 #include <cstdlib>
 #include <string>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
+#include <entt/core/type_traits.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
+#include <entt/meta/node.hpp>
 #include <entt/meta/resolve.hpp>
 
 struct base_t {

+ 1 - 0
test/entt/meta/meta_dtor.cpp

@@ -1,5 +1,6 @@
 #include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/node.hpp>

+ 2 - 0
test/entt/meta/meta_func.cpp

@@ -1,3 +1,5 @@
+#include <cstddef>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/core/utility.hpp>

+ 1 - 1
test/entt/meta/meta_handle.cpp

@@ -1,8 +1,8 @@
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
-#include <entt/meta/resolve.hpp>
 
 struct clazz_t {
     clazz_t()

+ 1 - 1
test/entt/meta/meta_pointer.cpp

@@ -1,7 +1,7 @@
 #include <memory>
 #include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
-#include <entt/core/hashed_string.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/pointer.hpp>
 #include <entt/meta/resolve.hpp>

+ 2 - 1
test/entt/meta/meta_prop.cpp

@@ -1,5 +1,6 @@
+#include <cstring>
 #include <tuple>
-#include <string>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>

+ 1 - 0
test/entt/meta/meta_range.cpp

@@ -1,3 +1,4 @@
+#include <type_traits>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>

+ 4 - 0
test/entt/meta/meta_type.cpp

@@ -1,10 +1,14 @@
+#include <algorithm>
 #include <map>
 #include <memory>
 #include <utility>
 #include <vector>
 #include <gtest/gtest.h>
 #include <entt/core/hashed_string.hpp>
+#include <entt/core/type_info.hpp>
+#include <entt/core/utility.hpp>
 #include <entt/meta/container.hpp>
+#include <entt/meta/ctx.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/pointer.hpp>

+ 3 - 1
test/entt/meta/meta_utility.cpp

@@ -1,5 +1,7 @@
-#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/type_traits.hpp>
+#include <entt/meta/meta.hpp>
 #include <entt/meta/resolve.hpp>
 #include <entt/meta/utility.hpp>
 

+ 4 - 2
test/entt/poly/poly.cpp

@@ -1,6 +1,8 @@
-#include <functional>
-#include <type_traits>
+#include <cstddef>
+#include <cstdint>
+#include <utility>
 #include <gtest/gtest.h>
+#include <entt/core/type_info.hpp>
 #include <entt/core/type_traits.hpp>
 #include <entt/poly/poly.hpp>
 

+ 1 - 0
test/entt/process/scheduler.cpp

@@ -1,4 +1,5 @@
 #include <functional>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/process/process.hpp>
 #include <entt/process/scheduler.hpp>

+ 5 - 0
test/entt/resource/resource.cpp

@@ -1,8 +1,13 @@
+#include <memory>
 #include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
+#include <entt/config/config.h>
 #include <entt/core/hashed_string.hpp>
 #include <entt/core/type_info.hpp>
 #include <entt/resource/cache.hpp>
+#include <entt/resource/handle.hpp>
+#include <entt/resource/loader.hpp>
 
 struct resource {
     virtual ~resource() = default;

+ 1 - 0
test/entt/signal/delegate.cpp

@@ -1,5 +1,6 @@
 #include <memory>
 #include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/signal/delegate.hpp>
 

+ 1 - 1
test/entt/signal/dispatcher.cpp

@@ -1,4 +1,4 @@
-#include <type_traits>
+#include <utility>
 #include <gtest/gtest.h>
 #include <entt/core/type_traits.hpp>
 #include <entt/signal/dispatcher.hpp>

+ 0 - 1
test/entt/signal/sigh.cpp

@@ -3,7 +3,6 @@
 #include <gtest/gtest.h>
 #include <entt/signal/sigh.hpp>
 #include "../common/throwing_allocator.hpp"
-#include "../common/throwing_type.hpp"
 
 struct sigh_listener {
     static void f(int &v) {

+ 2 - 1
test/example/custom_identifier.cpp

@@ -1,5 +1,6 @@
-#include <type_traits>
+#include <cstdint>
 #include <gtest/gtest.h>
+#include <entt/config/config.h>
 #include <entt/entity/entity.hpp>
 #include <entt/entity/registry.hpp>
 

+ 1 - 1
test/example/entity_copy.cpp

@@ -1,5 +1,5 @@
 #include <gtest/gtest.h>
-#include <entt/core/utility.hpp>
+#include <entt/core/hashed_string.hpp>
 #include <entt/entity/registry.hpp>
 
 enum class my_entity : entt::id_type {};

+ 1 - 0
test/lib/dispatcher/main.cpp

@@ -2,6 +2,7 @@
 #include <entt/core/attribute.h>
 #include <entt/core/utility.hpp>
 #include <entt/signal/dispatcher.hpp>
+#include <entt/signal/sigh.hpp>
 #include "types.h"
 
 ENTT_API void trigger(entt::dispatcher &);

+ 1 - 0
test/lib/dispatcher_plugin/main.cpp

@@ -3,6 +3,7 @@
 #include <gtest/gtest.h>
 #include <cr.h>
 #include <entt/signal/dispatcher.hpp>
+#include <entt/signal/sigh.hpp>
 #include "types.h"
 
 struct listener {

+ 0 - 1
test/lib/meta/lib.cpp

@@ -2,7 +2,6 @@
 #include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
-#include <entt/meta/resolve.hpp>
 #include "types.h"
 
 position create_position(int x, int y) {

+ 1 - 0
test/lib/meta/main.cpp

@@ -1,5 +1,6 @@
 #include <gtest/gtest.h>
 #include <entt/core/attribute.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/resolve.hpp>

+ 1 - 0
test/lib/meta_plugin/main.cpp

@@ -2,6 +2,7 @@
 
 #include <gtest/gtest.h>
 #include <cr.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/resolve.hpp>

+ 1 - 1
test/lib/meta_plugin/plugin.cpp

@@ -1,8 +1,8 @@
 #include <cr.h>
 #include <entt/core/hashed_string.hpp>
+#include <entt/meta/ctx.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
-#include <entt/meta/resolve.hpp>
 #include "types.h"
 
 position create_position(int x, int y) {

+ 1 - 0
test/lib/meta_plugin_std/main.cpp

@@ -2,6 +2,7 @@
 
 #include <gtest/gtest.h>
 #include <cr.h>
+#include <entt/core/hashed_string.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
 #include <entt/meta/resolve.hpp>

+ 1 - 1
test/lib/meta_plugin_std/plugin.cpp

@@ -1,8 +1,8 @@
 #include <cr.h>
 #include <entt/core/hashed_string.hpp>
+#include <entt/meta/ctx.hpp>
 #include <entt/meta/factory.hpp>
 #include <entt/meta/meta.hpp>
-#include <entt/meta/resolve.hpp>
 #include "types.h"
 
 position create_position(int x, int y) {

+ 1 - 0
test/snapshot/snapshot.cpp

@@ -2,6 +2,7 @@
 #include <vector>
 #include <gtest/gtest.h>
 #include <cereal/archives/json.hpp>
+#include <entt/core/hashed_string.hpp>
 #include <entt/entity/helper.hpp>
 #include <entt/entity/registry.hpp>
 #include <entt/entity/snapshot.hpp>