mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-21 09:35:27 -04:00
763d8e8175
* Also fix the Bitmap Font field not shown in the parameters of the action to change it.
36 lines
1.1 KiB
C++
36 lines
1.1 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 common features of GDevelop Core.
|
|
*/
|
|
#include <string>
|
|
|
|
#include "GDCore/CommonTools.h"
|
|
#include "GDCore/Project/Project.h"
|
|
#include "GDCore/Serialization/Serializer.h"
|
|
#include "GDCore/Tools/VersionWrapper.h"
|
|
#include "catch.hpp"
|
|
|
|
TEST_CASE("Resources", "[common][resources]") {
|
|
SECTION("Basics") {
|
|
gd::ImageResource image;
|
|
image.SetName("MyResourceName");
|
|
|
|
REQUIRE(image.GetName() == "MyResourceName");
|
|
}
|
|
SECTION("Filename handling") {
|
|
gd::ImageResource image;
|
|
image.SetFile("MyResourceFile");
|
|
REQUIRE(image.GetFile() == "MyResourceFile");
|
|
image.SetFile("My/relative/ResourceFile");
|
|
REQUIRE(image.GetFile() == "My/relative/ResourceFile");
|
|
image.SetFile("..\\My\\windows\\style\\relative\\ResourceFile");
|
|
REQUIRE(image.GetFile() == "../My/windows/style/relative/ResourceFile");
|
|
image.SetFile("Lots\\\\Of\\\\\\..\\Backslashs");
|
|
REQUIRE(image.GetFile() == "Lots//Of///../Backslashs");
|
|
}
|
|
}
|