summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/Generating/Stubs.cpp6
-rw-r--r--tests/LuaThreadStress/Stubs.cpp15
-rw-r--r--tests/SchematicFileSerializer/Stubs.cpp13
3 files changed, 11 insertions, 23 deletions
diff --git a/tests/Generating/Stubs.cpp b/tests/Generating/Stubs.cpp
index 6fbcf70fb..2982457ab 100644
--- a/tests/Generating/Stubs.cpp
+++ b/tests/Generating/Stubs.cpp
@@ -406,7 +406,9 @@ void cItem::Empty()
-cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
+cBlockHandler & cBlockHandler::GetBlockHandler(BLOCKTYPE a_BlockType)
{
- return new cBlockHandler(a_BlockType);
+ // Dummy handler.
+ static cBlockHandler Handler(E_BLOCK_AIR);
+ return Handler;
}
diff --git a/tests/LuaThreadStress/Stubs.cpp b/tests/LuaThreadStress/Stubs.cpp
index db0e8826a..f921477b7 100644
--- a/tests/LuaThreadStress/Stubs.cpp
+++ b/tests/LuaThreadStress/Stubs.cpp
@@ -86,16 +86,15 @@ extern "C" int luaopen_lxp(lua_State * a_LuaState)
-void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
+cBlockInfo::cBlockInfo()
{
- delete a_Handler;
}
-cBlockInfo::cBlockInfo()
+cBlockInfo::cBlockInfoArray::cBlockInfoArray()
{
}
@@ -103,15 +102,9 @@ cBlockInfo::cBlockInfo()
-cBlockInfo::cBlockInfoArray::cBlockInfoArray()
+cBlockHandler * cBlockInfo::GetHandler(BLOCKTYPE a_Type)
{
- cBlockInfoArray & BlockInfos = *this;
- // The piece-loading code uses the handlers for rotations, so we need valid handlers
- // Insert dummy handlers:
- for (size_t i = 0; i < BlockInfos.size(); i++)
- {
- BlockInfos[i].m_Handler.reset(new cBlockHandler(static_cast<BLOCKTYPE>(i)));
- }
+ return nullptr;
}
diff --git a/tests/SchematicFileSerializer/Stubs.cpp b/tests/SchematicFileSerializer/Stubs.cpp
index 93fb5f2f6..882175754 100644
--- a/tests/SchematicFileSerializer/Stubs.cpp
+++ b/tests/SchematicFileSerializer/Stubs.cpp
@@ -21,24 +21,17 @@ cBlockInfo::cBlockInfo()
-void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
+cBlockInfo::cBlockInfoArray::cBlockInfoArray()
{
- delete a_Handler;
}
-cBlockInfo::cBlockInfoArray::cBlockInfoArray()
+cBlockHandler * cBlockInfo::GetHandler(BLOCKTYPE a_Type)
{
- cBlockInfoArray & BlockInfos = *this;
- // The piece-loading code uses the handlers for rotations, so we need valid handlers
- // Insert dummy handlers:
- for (size_t i = 0; i < BlockInfos.size(); i++)
- {
- BlockInfos[i].m_Handler.reset(new cBlockHandler(static_cast<BLOCKTYPE>(i)));
- }
+ return nullptr;
}