From 0709c402f8a7613a499b2eada0ed2387c36a3381 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 5 Oct 2020 16:54:20 +0200 Subject: [PATCH] test: reduced the amount of madness by a few degrees :) --- test/entt/core/algorithm.cpp | 24 +++---- test/entt/entity/group.cpp | 48 +++++++------- test/entt/entity/registry.cpp | 110 ++++++++++++++++---------------- test/entt/entity/sparse_set.cpp | 6 +- test/entt/entity/storage.cpp | 6 +- test/entt/entity/view.cpp | 10 +-- test/entt/process/scheduler.cpp | 8 +-- test/entt/resource/resource.cpp | 14 ++-- 8 files changed, 113 insertions(+), 113 deletions(-) diff --git a/test/entt/core/algorithm.cpp b/test/entt/core/algorithm.cpp index 254d2424b..520432054 100644 --- a/test/entt/core/algorithm.cpp +++ b/test/entt/core/algorithm.cpp @@ -13,8 +13,8 @@ TEST(Algorithm, StdSort) { sort(arr.begin(), arr.end()); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_LT(arr[i], arr[i+1]); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_LT(arr[i], arr[i+1u]); } } @@ -27,8 +27,8 @@ TEST(Algorithm, StdSortBoxedInt) { return lhs.value > rhs.value; }); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_GT(arr[i].value, arr[i+1].value); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_GT(arr[i].value, arr[i+1u].value); } } @@ -38,8 +38,8 @@ TEST(Algorithm, InsertionSort) { sort(arr.begin(), arr.end()); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_LT(arr[i], arr[i+1]); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_LT(arr[i], arr[i+1u]); } } @@ -51,8 +51,8 @@ TEST(Algorithm, InsertionSortBoxedInt) { return lhs.value > rhs.value; }); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_GT(arr[i].value, arr[i+1].value); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_GT(arr[i].value, arr[i+1u].value); } } @@ -71,8 +71,8 @@ TEST(Algorithm, RadixSort) { return value; }); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_LT(arr[i], arr[i+1]); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_LT(arr[i], arr[i+1u]); } } @@ -84,8 +84,8 @@ TEST(Algorithm, RadixSortBoxedInt) { return instance.value; }); - for(typename decltype(arr)::size_type i = 0; i < (arr.size() - 1); ++i) { - ASSERT_GT(arr[i].value, arr[i+1].value); + for(auto i = 0u; i < (arr.size() - 1u); ++i) { + ASSERT_GT(arr[i].value, arr[i+1u].value); } } diff --git a/test/entt/entity/group.cpp b/test/entt/entity/group.cpp index 026cb9504..0c4cba6e1 100644 --- a/test/entt/entity/group.cpp +++ b/test/entt/entity/group.cpp @@ -41,21 +41,21 @@ TEST(NonOwningGroup, Functionalities) { ASSERT_NE(cgroup.begin(), cgroup.end()); ASSERT_NE(group.rbegin(), group.rend()); ASSERT_NE(cgroup.rbegin(), cgroup.rend()); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(cgroup.size(), 2u); registry.emplace(e0); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 2u); + ASSERT_EQ(group.size(), 2u); + ASSERT_EQ(cgroup.size(), 2u); registry.remove(e0); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(cgroup.size(), 2u); registry.get(e0) = '1'; registry.get(e1) = '2'; @@ -106,7 +106,7 @@ TEST(NonOwningGroup, ElementAccess) { registry.emplace(e1); registry.emplace(e1); - for(typename decltype(group)::size_type i{}; i < group.size(); ++i) { + for(auto i = 0u; i < group.size(); ++i) { ASSERT_EQ(group[i], i ? e0 : e1); ASSERT_EQ(cgroup[i], i ? e0 : e1); } @@ -310,7 +310,7 @@ TEST(NonOwningGroup, IndexRebuiltOnDestroy) { registry.destroy(e0); registry.emplace(registry.create(), 42); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); + ASSERT_EQ(group.size(), 1u); ASSERT_EQ(group[{}], e1); ASSERT_EQ(group.get(e1), 1); ASSERT_EQ(group.get(e1), 1u); @@ -479,7 +479,7 @@ TEST(NonOwningGroup, EmptyAndNonEmptyTypes) { ASSERT_TRUE(entt == e0 || entt == e1); } - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 2u); } TEST(NonOwningGroup, TrackEntitiesOnComponentDestruction) { @@ -607,21 +607,21 @@ TEST(OwningGroup, Functionalities) { ASSERT_NE(cgroup.begin(), cgroup.end()); ASSERT_NE(group.rbegin(), group.rend()); ASSERT_NE(cgroup.rbegin(), cgroup.rend()); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(cgroup.size(), 2u); registry.emplace(e0); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 2u); + ASSERT_EQ(group.size(), 2u); + ASSERT_EQ(cgroup.size(), 2u); registry.remove(e0); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); - ASSERT_EQ(cgroup.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(group.size(), 1u); + ASSERT_EQ(cgroup.size(), 2u); registry.get(e0) = '1'; registry.get(e1) = '2'; @@ -669,7 +669,7 @@ TEST(OwningGroup, ElementAccess) { registry.emplace(e1); registry.emplace(e1); - for(typename decltype(group)::size_type i{}; i < group.size(); ++i) { + for(auto i = 0u; i < group.size(); ++i) { ASSERT_EQ(group[i], i ? e0 : e1); ASSERT_EQ(cgroup[i], i ? e0 : e1); } @@ -957,7 +957,7 @@ TEST(OwningGroup, IndexRebuiltOnDestroy) { registry.destroy(e0); registry.emplace(registry.create(), 42); - ASSERT_EQ(group.size(), typename decltype(group)::size_type{1}); + ASSERT_EQ(group.size(), 1u); ASSERT_EQ(group[{}], e1); ASSERT_EQ(group.get(e1), 1); ASSERT_EQ(group.get(e1), 1u); @@ -1136,7 +1136,7 @@ TEST(OwningGroup, EmptyAndNonEmptyTypes) { ASSERT_TRUE(entt == e0 || entt == e1); } - ASSERT_EQ(group.size(), typename decltype(group)::size_type{2}); + ASSERT_EQ(group.size(), 2u); } TEST(OwningGroup, TrackEntitiesOnComponentDestruction) { diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index c44742ccd..6b6716f7f 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -100,17 +100,17 @@ TEST(Registry, Context) { TEST(Registry, Functionalities) { entt::registry registry; - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); - ASSERT_EQ(registry.alive(), entt::registry::size_type{0}); + ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.alive(), 0u); ASSERT_NO_THROW((registry.reserve(8))); ASSERT_NO_THROW(registry.reserve(42)); ASSERT_TRUE(registry.empty()); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{42}); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{8}); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{8}); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); + ASSERT_EQ(registry.capacity(), 42u); + ASSERT_EQ(registry.capacity(), 8u); + ASSERT_EQ(registry.capacity(), 8u); + ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 0u); ASSERT_TRUE((registry.empty())); registry.prepare(); @@ -124,8 +124,8 @@ TEST(Registry, Functionalities) { ASSERT_TRUE(registry.has<>(e0)); ASSERT_FALSE(registry.any<>(e1)); - ASSERT_EQ(registry.size(), entt::registry::size_type{1}); - ASSERT_EQ(registry.size(), entt::registry::size_type{1}); + ASSERT_EQ(registry.size(), 1u); + ASSERT_EQ(registry.size(), 1u); ASSERT_FALSE(registry.empty()); ASSERT_FALSE(registry.empty()); @@ -186,28 +186,28 @@ TEST(Registry, Functionalities) { ASSERT_EQ(static_cast(registry).get(e0), 1); ASSERT_EQ(static_cast(registry).get(e1), 1); - ASSERT_EQ(registry.size(), entt::registry::size_type{3}); - ASSERT_EQ(registry.alive(), entt::registry::size_type{3}); + ASSERT_EQ(registry.size(), 3u); + ASSERT_EQ(registry.alive(), 3u); ASSERT_FALSE(registry.empty()); - ASSERT_EQ(registry.version(e2), entt::registry::version_type{0}); - ASSERT_EQ(registry.current(e2), entt::registry::version_type{0}); + ASSERT_EQ(registry.version(e2), 0u); + ASSERT_EQ(registry.current(e2), 0u); ASSERT_NO_THROW(registry.destroy(e2)); - ASSERT_EQ(registry.version(e2), entt::registry::version_type{0}); - ASSERT_EQ(registry.current(e2), entt::registry::version_type{1}); + ASSERT_EQ(registry.version(e2), 0u); + ASSERT_EQ(registry.current(e2), 1u); ASSERT_TRUE(registry.valid(e0)); ASSERT_TRUE(registry.valid(e1)); ASSERT_FALSE(registry.valid(e2)); - ASSERT_EQ(registry.size(), entt::registry::size_type{3}); - ASSERT_EQ(registry.alive(), entt::registry::size_type{2}); + ASSERT_EQ(registry.size(), 3u); + ASSERT_EQ(registry.alive(), 2u); ASSERT_FALSE(registry.empty()); ASSERT_NO_THROW(registry.clear()); - ASSERT_EQ(registry.size(), entt::registry::size_type{3}); - ASSERT_EQ(registry.alive(), entt::registry::size_type{0}); + ASSERT_EQ(registry.size(), 3u); + ASSERT_EQ(registry.alive(), 0u); ASSERT_TRUE(registry.empty()); const auto e3 = registry.create(); @@ -215,8 +215,8 @@ TEST(Registry, Functionalities) { ASSERT_EQ(registry.get_or_emplace(e3, 3), 3); ASSERT_EQ(registry.get_or_emplace(e3, 'c'), 'c'); - ASSERT_EQ(registry.size(), entt::registry::size_type{1}); - ASSERT_EQ(registry.size(), entt::registry::size_type{1}); + ASSERT_EQ(registry.size(), 1u); + ASSERT_EQ(registry.size(), 1u); ASSERT_FALSE(registry.empty()); ASSERT_FALSE(registry.empty()); ASSERT_TRUE((registry.has(e3))); @@ -225,15 +225,15 @@ TEST(Registry, Functionalities) { ASSERT_NO_THROW(registry.clear()); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); - ASSERT_EQ(registry.size(), entt::registry::size_type{1}); + ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 1u); ASSERT_TRUE(registry.empty()); ASSERT_FALSE(registry.empty()); ASSERT_NO_THROW(registry.clear()); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); + ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 0u); ASSERT_TRUE((registry.empty())); const auto e4 = registry.create(); @@ -244,17 +244,17 @@ TEST(Registry, Functionalities) { ASSERT_EQ(registry.remove_if_exists(e4), 1u); ASSERT_EQ(registry.remove_if_exists(e5), 0u); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); - ASSERT_EQ(registry.size(), entt::registry::size_type{0}); + ASSERT_EQ(registry.size(), 0u); + ASSERT_EQ(registry.size(), 0u); ASSERT_TRUE(registry.empty()); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{8}); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{8}); + ASSERT_EQ(registry.capacity(), 8u); + ASSERT_EQ(registry.capacity(), 8u); registry.shrink_to_fit(); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{}); - ASSERT_EQ(registry.capacity(), entt::registry::size_type{}); + ASSERT_EQ(registry.capacity(), 0u); + ASSERT_EQ(registry.capacity(), 0u); } TEST(Registry, ReplaceAggregate) { @@ -703,27 +703,27 @@ TEST(Registry, CleanViewAfterRemoveAndClear) { registry.emplace(entity, 0); registry.emplace(entity, 'c'); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{1}); + ASSERT_EQ(view.size_hint(), 1u); registry.remove(entity); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{0}); + ASSERT_EQ(view.size_hint(), 0u); registry.emplace(entity, 'c'); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{1}); + ASSERT_EQ(view.size_hint(), 1u); registry.clear(); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{0}); + ASSERT_EQ(view.size_hint(), 0u); registry.emplace(entity, 0); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{1}); + ASSERT_EQ(view.size_hint(), 1u); registry.clear(); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{0}); + ASSERT_EQ(view.size_hint(), 0u); } TEST(Registry, CleanNonOwningGroupViewAfterRemoveAndClear) { @@ -734,27 +734,27 @@ TEST(Registry, CleanNonOwningGroupViewAfterRemoveAndClear) { registry.emplace(entity, 0); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.remove(entity); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 0); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); } TEST(Registry, CleanFullOwningGroupViewAfterRemoveAndClear) { @@ -765,27 +765,27 @@ TEST(Registry, CleanFullOwningGroupViewAfterRemoveAndClear) { registry.emplace(entity, 0); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.remove(entity); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 0); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); } TEST(Registry, CleanPartialOwningGroupViewAfterRemoveAndClear) { @@ -796,27 +796,27 @@ TEST(Registry, CleanPartialOwningGroupViewAfterRemoveAndClear) { registry.emplace(entity, 0); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.remove(entity); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 'c'); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); registry.emplace(entity, 0); - ASSERT_EQ(group.size(), entt::registry::size_type{1}); + ASSERT_EQ(group.size(), 1u); registry.clear(); - ASSERT_EQ(group.size(), entt::registry::size_type{0}); + ASSERT_EQ(group.size(), 0u); } TEST(Registry, NestedGroups) { diff --git a/test/entt/entity/sparse_set.cpp b/test/entt/entity/sparse_set.cpp index 608680b25..ce92032d4 100644 --- a/test/entt/entity/sparse_set.cpp +++ b/test/entt/entity/sparse_set.cpp @@ -749,12 +749,12 @@ TEST(SparseSet, CanModifyDuringIteration) { entt::sparse_set set; set.emplace(entt::entity{0}); - ASSERT_EQ(set.capacity(), entt::sparse_set::size_type{1}); + ASSERT_EQ(set.capacity(), 1u); const auto it = set.begin(); - set.reserve(entt::sparse_set::size_type{2}); + set.reserve(2u); - ASSERT_EQ(set.capacity(), entt::sparse_set::size_type{2}); + ASSERT_EQ(set.capacity(), 2u); // this should crash with asan enabled if we break the constraint const auto entity = *it; diff --git a/test/entt/entity/storage.cpp b/test/entt/entity/storage.cpp index a6df1d660..8293ed27f 100644 --- a/test/entt/entity/storage.cpp +++ b/test/entt/entity/storage.cpp @@ -708,12 +708,12 @@ TEST(Storage, CanModifyDuringIteration) { entt::storage pool; pool.emplace(entt::entity{0}, 42); - ASSERT_EQ(pool.capacity(), (entt::storage::size_type{1})); + ASSERT_EQ(pool.capacity(), 1u); const auto it = pool.cbegin(); - pool.reserve(entt::storage::size_type{2}); + pool.reserve(2u); - ASSERT_EQ(pool.capacity(), (entt::storage::size_type{2})); + ASSERT_EQ(pool.capacity(), 2u); // this should crash with asan enabled if we break the constraint const auto entity = *it; diff --git a/test/entt/entity/view.cpp b/test/entt/entity/view.cpp index 3cdd6f0ab..a863d226c 100644 --- a/test/entt/entity/view.cpp +++ b/test/entt/entity/view.cpp @@ -28,12 +28,12 @@ TEST(SingleComponentView, Functionalities) { ASSERT_NE(cview.begin(), cview.end()); ASSERT_NE(view.rbegin(), view.rend()); ASSERT_NE(cview.rbegin(), cview.rend()); - ASSERT_EQ(view.size(), typename decltype(view)::size_type{1}); + ASSERT_EQ(view.size(), 1u); ASSERT_FALSE(view.empty()); registry.emplace(e0); - ASSERT_EQ(view.size(), typename decltype(view)::size_type{2}); + ASSERT_EQ(view.size(), 2u); view.get(e0) = '1'; view.get(e1) = '2'; @@ -67,7 +67,7 @@ TEST(SingleComponentView, ElementAccess) { const auto e1 = registry.create(); registry.emplace(e1); - for(typename decltype(view)::size_type i{}; i < view.size(); ++i) { + for(auto i = 0u; i < view.size(); ++i) { ASSERT_EQ(view[i], i ? e0 : e1); ASSERT_EQ(cview[i], i ? e0 : e1); } @@ -102,7 +102,7 @@ TEST(SingleComponentView, Empty) { auto view = registry.view(); - ASSERT_EQ(view.size(), entt::registry::size_type{0}); + ASSERT_EQ(view.size(), 0u); ASSERT_EQ(view.begin(), view.end()); ASSERT_EQ(view.rbegin(), view.rend()); } @@ -414,7 +414,7 @@ TEST(MultiComponentView, Empty) { auto view = registry.view(); - ASSERT_EQ(view.size_hint(), entt::registry::size_type{1}); + ASSERT_EQ(view.size_hint(), 1u); ASSERT_EQ(view.begin(), view.end()); ASSERT_EQ(view.rbegin(), view.rend()); } diff --git a/test/entt/process/scheduler.cpp b/test/entt/process/scheduler.cpp index 4da09bd3c..2338ced57 100644 --- a/test/entt/process/scheduler.cpp +++ b/test/entt/process/scheduler.cpp @@ -45,7 +45,7 @@ TEST(Scheduler, Functionalities) { bool updated = false; bool aborted = false; - ASSERT_EQ(scheduler.size(), entt::scheduler::size_type{}); + ASSERT_EQ(scheduler.size(), 0u); ASSERT_TRUE(scheduler.empty()); scheduler.attach( @@ -53,7 +53,7 @@ TEST(Scheduler, Functionalities) { [&aborted](){ aborted = true; } ); - ASSERT_NE(scheduler.size(), entt::scheduler::size_type{}); + ASSERT_NE(scheduler.size(), 0u); ASSERT_FALSE(scheduler.empty()); scheduler.update(0); @@ -62,12 +62,12 @@ TEST(Scheduler, Functionalities) { ASSERT_TRUE(updated); ASSERT_TRUE(aborted); - ASSERT_NE(scheduler.size(), entt::scheduler::size_type{}); + ASSERT_NE(scheduler.size(), 0u); ASSERT_FALSE(scheduler.empty()); scheduler.clear(); - ASSERT_EQ(scheduler.size(), entt::scheduler::size_type{}); + ASSERT_EQ(scheduler.size(), 0u); ASSERT_TRUE(scheduler.empty()); } diff --git a/test/entt/resource/resource.cpp b/test/entt/resource/resource.cpp index 4b09ceb63..ebf0bb5f2 100644 --- a/test/entt/resource/resource.cpp +++ b/test/entt/resource/resource.cpp @@ -23,7 +23,7 @@ TEST(Resource, Functionalities) { constexpr auto hs1 = entt::hashed_string{"res1"}; constexpr auto hs2 = entt::hashed_string{"res2"}; - ASSERT_EQ(cache.size(), entt::resource_cache::size_type{}); + ASSERT_EQ(cache.size(), 0u); ASSERT_TRUE(cache.empty()); ASSERT_FALSE(cache.contains(hs1)); ASSERT_FALSE(cache.contains(hs2)); @@ -31,7 +31,7 @@ TEST(Resource, Functionalities) { ASSERT_FALSE(cache.load(hs1, 42)); ASSERT_FALSE(cache.reload(hs1, 42)); - ASSERT_EQ(cache.size(), entt::resource_cache::size_type{}); + ASSERT_EQ(cache.size(), 0u); ASSERT_TRUE(cache.empty()); ASSERT_FALSE(cache.contains(hs1)); ASSERT_FALSE(cache.contains(hs2)); @@ -39,7 +39,7 @@ TEST(Resource, Functionalities) { ASSERT_TRUE(cache.load(hs1, 42)); ASSERT_TRUE(cache.reload(hs1, 42)); - ASSERT_NE(cache.size(), entt::resource_cache::size_type{}); + ASSERT_NE(cache.size(), 0u); ASSERT_FALSE(cache.empty()); ASSERT_TRUE(cache.contains(hs1)); ASSERT_FALSE(cache.contains(hs2)); @@ -48,7 +48,7 @@ TEST(Resource, Functionalities) { ASSERT_TRUE(cache.load(hs1, 42)); ASSERT_TRUE(cache.load(hs2, 42)); - ASSERT_NE(cache.size(), entt::resource_cache::size_type{}); + ASSERT_NE(cache.size(), 0u); ASSERT_FALSE(cache.empty()); ASSERT_TRUE(cache.contains(hs1)); ASSERT_TRUE(cache.contains(hs2)); @@ -64,14 +64,14 @@ TEST(Resource, Functionalities) { ASSERT_TRUE(cache.load(hs1, 42)); ASSERT_NO_THROW(cache.clear()); - ASSERT_EQ(cache.size(), entt::resource_cache::size_type{}); + ASSERT_EQ(cache.size(), 0u); ASSERT_TRUE(cache.empty()); ASSERT_FALSE(cache.contains(hs1)); ASSERT_FALSE(cache.contains(hs2)); ASSERT_TRUE(cache.load(hs1, 42)); - ASSERT_NE(cache.size(), entt::resource_cache::size_type{}); + ASSERT_NE(cache.size(), 0u); ASSERT_FALSE(cache.empty()); ASSERT_TRUE(cache.handle(hs1)); ASSERT_FALSE(cache.handle(hs2)); @@ -80,7 +80,7 @@ TEST(Resource, Functionalities) { ASSERT_EQ(&cache.handle(hs1).get(), &static_cast(cache.handle(hs1))); ASSERT_NO_THROW(cache.clear()); - ASSERT_EQ(cache.size(), entt::resource_cache::size_type{}); + ASSERT_EQ(cache.size(), 0u); ASSERT_TRUE(cache.empty()); ASSERT_TRUE(cache.temp(42));