ATTRIB: removed test files
parent
8f55546150
commit
d2f48792fb
|
@ -1,5 +0,0 @@
|
|||
function init()
|
||||
local test1 = attrib.createContainer("test1")
|
||||
test1:absolute("ATTACKRANGE", 2.0)
|
||||
test1:register()
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
function init()
|
||||
local test1 = attrib.createContainer("test1")
|
||||
test1:absolute("FOO", 2.0)
|
||||
test1:register()
|
||||
end
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue