restructure into smaller files & add IWYU/clang-tidy
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
660736133a
commit
13eee8b168
28 changed files with 845 additions and 556 deletions
27
src/objects/object.cpp
Normal file
27
src/objects/object.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "ikarus/objects/object.h"
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <ikarus/objects/object_type.h>
|
||||
|
||||
IkarusObjectType ikarus_object_get_type(IkarusObject object) {
|
||||
return object.type;
|
||||
}
|
||||
|
||||
TEST_CASE("object_type", "[object]") {
|
||||
auto types = {
|
||||
IkarusObjectType_Blueprint,
|
||||
IkarusObjectType_Property,
|
||||
IkarusObjectType_Entity,
|
||||
IkarusObjectType_BlueprintFolder,
|
||||
IkarusObjectType_PropertyFolder,
|
||||
IkarusObjectType_EntityFolder,
|
||||
};
|
||||
|
||||
for (auto type : types) {
|
||||
auto object = IkarusObject{.type = type};
|
||||
REQUIRE(ikarus_object_get_type(object) == type);
|
||||
}
|
||||
}
|
||||
16
src/objects/object_type.cpp
Normal file
16
src/objects/object_type.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "ikarus/objects/object_type.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <ikarus/folders/folder_type.h>
|
||||
|
||||
IkarusObjectType ikarus_folder_type_to_object_type(IkarusFolderType type) {
|
||||
return static_cast<IkarusObjectType>(type);
|
||||
}
|
||||
|
||||
TEST_CASE("folder_to_object_type_conversion", "[object_type]") {
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_None) == IkarusObjectType_None);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_BlueprintFolder) == IkarusObjectType_BlueprintFolder);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_PropertyFolder) == IkarusObjectType_PropertyFolder);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_EntityFolder) == IkarusObjectType_EntityFolder);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue