mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 01:55:25 -04:00
18e8020bf5
* Actions, conditions and expressions related to opacity, size (width/height), scale, animations and other common features are now visible only once when you search for them in actions/conditions (instead of being shown once for every type of object supporting them). This reduces the risk of confusion for new or existing users, notably when multiple versions of the same action were returned by the search and was making it difficult to choose the proper one. * Internally, this works thanks to default, built-in behaviors that are supported by the objects.
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
/*
|
|
* GDevelop Core
|
|
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
|
|
* reserved. This project is released under the MIT License.
|
|
*/
|
|
/**
|
|
* @file Tests covering serialization to JSON.
|
|
*/
|
|
#include "GDCore/Project/Object.h"
|
|
#include "DummyPlatform.h"
|
|
#include "GDCore/CommonTools.h"
|
|
#include "GDCore/Events/Builtin/StandardEvent.h"
|
|
#include "GDCore/Events/Event.h"
|
|
#include "GDCore/Events/EventsList.h"
|
|
#include "GDCore/Events/Serialization.h"
|
|
#include "GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h"
|
|
#include "GDCore/Extensions/Platform.h"
|
|
#include "GDCore/Project/CustomObjectConfiguration.h"
|
|
#include "GDCore/Project/EventsFunctionsExtension.h"
|
|
#include "GDCore/Project/Layout.h"
|
|
#include "GDCore/Project/ObjectsContainer.h"
|
|
#include "GDCore/Project/Project.h"
|
|
#include "GDCore/Project/Variable.h"
|
|
#include "GDCore/Serialization/Serializer.h"
|
|
#include "GDCore/Tools/SystemStats.h"
|
|
#include "GDCore/Tools/VersionWrapper.h"
|
|
#include "catch.hpp"
|
|
|
|
using namespace gd;
|
|
|
|
TEST_CASE("Object", "[common]") {
|
|
|
|
SECTION("Create an object with default behaviors") {
|
|
gd::Platform platform;
|
|
gd::Project project;
|
|
SetupProjectWithDummyPlatform(project, platform);
|
|
|
|
gd::Layout &layout = project.InsertNewLayout("Scene", 0);
|
|
gd::Object &object = layout.InsertNewObject(
|
|
project, "MyExtension::FakeObjectWithDefaultBehavior", "MyObject", 0);
|
|
|
|
REQUIRE(object.HasBehaviorNamed("Effect"));
|
|
REQUIRE(object.GetBehavior("Effect").IsDefaultBehavior());
|
|
}
|
|
} |