ATTRIB: removed test files

master
Martin Gerhardy 2018-05-07 22:56:53 +02:00
parent 8f55546150
commit d2f48792fb
3 changed files with 18 additions and 14 deletions

View File

@ -1,5 +0,0 @@
function init()
local test1 = attrib.createContainer("test1")
test1:absolute("ATTACKRANGE", 2.0)
test1:register()
end

View File

@ -1,5 +0,0 @@
function init()
local test1 = attrib.createContainer("test1")
test1:absolute("FOO", 2.0)
test1:register()
end

View File

@ -5,6 +5,22 @@
#include "core/tests/AbstractTest.h"
#include "attrib/ContainerProvider.h"
const char *TestLoadingSuccess = R"(
function init()
local test1 = attrib.createContainer("test1")
test1:absolute("ATTACKRANGE", 2.0)
test1:register()
end
)";
const char *TestLoadingUnknownType = R"(
function init()
local test1 = attrib.createContainer("test1")
test1:absolute("FOO", 2.0)
test1:register()
end
)";
namespace attrib {
class ContainerProviderTest: public core::AbstractTest {
@ -12,14 +28,12 @@ class ContainerProviderTest: public core::AbstractTest {
TEST_F(ContainerProviderTest, testLoadingSuccess) {
ContainerProvider p;
const std::string& attributes = _testApp->filesystem()->load("testattributes.lua");
ASSERT_TRUE(p.init(attributes)) << p.error();
ASSERT_TRUE(p.init(TestLoadingSuccess)) << p.error();
}
TEST_F(ContainerProviderTest, testLoadingUnknownType) {
ContainerProvider p;
const std::string& attributes = _testApp->filesystem()->load("testattributes_fail.lua");
ASSERT_FALSE(p.init(attributes)) << p.error();
ASSERT_FALSE(p.init(TestLoadingUnknownType)) << p.error();
}
}