test: refine lib tests
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#include <entt/config/config.h>
|
||||
#include <entt/signal/fwd.hpp>
|
||||
|
||||
ENTT_API void trigger(entt::dispatcher &);
|
||||
@@ -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;
|
||||
|
||||
@@ -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{});
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#include <entt/config/config.h>
|
||||
#include "../../../common/emitter.h"
|
||||
|
||||
ENTT_API void emit(test::emitter &);
|
||||
@@ -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,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);
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
@@ -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 &);
|
||||
@@ -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,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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#include <entt/config/config.h>
|
||||
#include "../types.h"
|
||||
|
||||
ENTT_API const void *filter(const view_type &);
|
||||
@@ -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{};
|
||||
|
||||
Reference in New Issue
Block a user