|
|
@@ -7,13 +7,13 @@
|
|
|
struct base {
|
|
|
virtual ~base() = default;
|
|
|
|
|
|
- virtual const entt::type_info &type() const noexcept {
|
|
|
+ [[nodiscard]] virtual const entt::type_info &type() const noexcept {
|
|
|
return entt::type_id<base>();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
struct derived: base {
|
|
|
- const entt::type_info &type() const noexcept override {
|
|
|
+ [[nodiscard]] const entt::type_info &type() const noexcept override {
|
|
|
return entt::type_id<derived>();
|
|
|
}
|
|
|
};
|
|
|
@@ -28,7 +28,7 @@ entt::resource<Type> dynamic_resource_cast(const entt::resource<Other> &other) {
|
|
|
}
|
|
|
|
|
|
TEST(Resource, Functionalities) {
|
|
|
- entt::resource<derived> resource{};
|
|
|
+ const entt::resource<derived> resource{};
|
|
|
|
|
|
ASSERT_FALSE(resource);
|
|
|
ASSERT_EQ(resource.operator->(), nullptr);
|
|
|
@@ -58,7 +58,7 @@ TEST(Resource, Functionalities) {
|
|
|
}
|
|
|
|
|
|
TEST(Resource, DerivedToBase) {
|
|
|
- entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
+ const entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
entt::resource<base> other{resource};
|
|
|
entt::resource<const base> cother{resource};
|
|
|
|
|
|
@@ -111,7 +111,7 @@ TEST(Resource, ConstNonConstAndAllInBetween) {
|
|
|
}
|
|
|
|
|
|
TEST(Resource, DynamicResourceHandleCast) {
|
|
|
- entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
+ const entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
entt::resource<const base> other = resource;
|
|
|
|
|
|
ASSERT_TRUE(other);
|
|
|
@@ -132,8 +132,8 @@ TEST(Resource, DynamicResourceHandleCast) {
|
|
|
}
|
|
|
|
|
|
TEST(Resource, Comparison) {
|
|
|
- entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
- entt::resource<const base> other = resource;
|
|
|
+ const entt::resource<derived> resource{std::make_shared<derived>()};
|
|
|
+ const entt::resource<const base> other = resource;
|
|
|
|
|
|
ASSERT_TRUE(resource == other);
|
|
|
ASSERT_FALSE(resource != other);
|