test: refine lib tests

This commit is contained in:
skypjack
2025-11-15 18:50:57 +01:00
parent f48d16a6e6
commit cffbf89d9b
18 changed files with 47 additions and 17 deletions
+1
View File
@@ -2,6 +2,7 @@
#include <entt/signal/dispatcher.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/empty.h"
#include "lib.h"
ENTT_API void trigger(entt::dispatcher &dispatcher) {
dispatcher.trigger<test::empty>();
+4
View File
@@ -0,0 +1,4 @@
#include <entt/config/config.h>
#include <entt/signal/fwd.hpp>
ENTT_API void trigger(entt::dispatcher &);
+1 -2
View File
@@ -5,8 +5,7 @@
#include <entt/signal/sigh.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/listener.h"
ENTT_API void trigger(entt::dispatcher &);
#include "lib.h"
TEST(Lib, Dispatcher) {
entt::dispatcher dispatcher;
+1
View File
@@ -2,6 +2,7 @@
#include "../../../common/boxed_type.h"
#include "../../../common/emitter.h"
#include "../../../common/empty.h"
#include "lib.h"
ENTT_API void emit(test::emitter &emitter) {
emitter.publish(test::empty{});
+4
View File
@@ -0,0 +1,4 @@
#include <entt/config/config.h>
#include "../../../common/emitter.h"
ENTT_API void emit(test::emitter &);
+1 -2
View File
@@ -3,8 +3,7 @@
#include <entt/config/config.h>
#include "../../../common/boxed_type.h"
#include "../../../common/emitter.h"
ENTT_API void emit(test::emitter &);
#include "lib.h"
TEST(Lib, Emitter) {
test::emitter emitter;
+1
View File
@@ -1,6 +1,7 @@
#include <entt/config/config.h>
#include <entt/locator/locator.hpp>
#include "../../../common/boxed_type.h"
#include "lib.h"
ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &handle) {
entt::locator<test::boxed_int>::reset(handle);
+6
View File
@@ -0,0 +1,6 @@
#include <entt/config/config.h>
#include <entt/locator/locator.hpp>
#include "../../../common/boxed_type.h"
ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &);
ENTT_API void use_service(int);
+1 -3
View File
@@ -2,9 +2,7 @@
#include <entt/config/config.h>
#include <entt/locator/locator.hpp>
#include "../../../common/boxed_type.h"
ENTT_API void set_up(const entt::locator<test::boxed_int>::node_type &);
ENTT_API void use_service(int);
#include "lib.h"
TEST(Lib, Locator) {
entt::locator<test::boxed_int>::emplace().value = 4;
+5
View File
@@ -6,11 +6,16 @@
#include <entt/meta/meta.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/empty.h"
#include "lib.h"
namespace {
test::boxed_int create_boxed_int(int value) {
return test::boxed_int{value};
}
} // namespace
ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &handle) {
entt::locator<entt::meta_ctx>::reset(handle);
}
+8
View File
@@ -0,0 +1,8 @@
#include <entt/config/config.h>
#include <entt/locator/locator.hpp>
#include <entt/meta/fwd.hpp>
ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &);
ENTT_API void set_up();
ENTT_API void tear_down();
ENTT_API entt::meta_any wrap_int(int);
+1 -5
View File
@@ -7,11 +7,7 @@
#include <entt/meta/resolve.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/empty.h"
ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &);
ENTT_API void set_up();
ENTT_API void tear_down();
ENTT_API entt::meta_any wrap_int(int);
#include "lib.h"
TEST(Lib, Meta) {
using namespace entt::literals;
+1
View File
@@ -4,6 +4,7 @@
#include <entt/entity/view.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/empty.h"
#include "lib.h"
template class entt::basic_registry<entt::entity>;
+5
View File
@@ -0,0 +1,5 @@
#include <entt/config/config.h>
#include <entt/entity/fwd.hpp>
ENTT_API void update(entt::registry &, int);
ENTT_API void insert(entt::registry &);
+1 -3
View File
@@ -6,9 +6,7 @@
#include <entt/entity/view.hpp>
#include "../../../common/boxed_type.h"
#include "../../../common/empty.h"
ENTT_API void update(entt::registry &, int);
ENTT_API void insert(entt::registry &);
#include "lib.h"
TEST(Lib, Registry) {
constexpr auto count = 3;
+1
View File
@@ -1,5 +1,6 @@
#include <entt/config/config.h>
#include "../types.h"
#include "lib.h"
ENTT_API const void *filter(const view_type &view) {
// forces the creation of all symbols for the view type
+4
View File
@@ -0,0 +1,4 @@
#include <entt/config/config.h>
#include "../types.h"
ENTT_API const void *filter(const view_type &);
+1 -2
View File
@@ -1,8 +1,7 @@
#include <gtest/gtest.h>
#include <entt/config/config.h>
#include "../types.h"
ENTT_API const void *filter(const view_type &);
#include "lib.h"
TEST(Lib, View) {
view_type view{};