-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5977: Add unit test checking that loading a map with an entity refer…
…encing a missing entityDef doesn't discard its child primitives, even after saving
- Loading branch information
1 parent
8acdb35
commit 824123c
Showing
6 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include "ifilesystem.h" | ||
|
||
namespace test | ||
{ | ||
|
||
namespace algorithm | ||
{ | ||
|
||
// Loads the entire text from the given vfs file into a string | ||
inline std::string loadTextFromVfsFile(const std::string& vfsPath) | ||
{ | ||
auto file = GlobalFileSystem().openTextFile(vfsPath); | ||
|
||
std::stringstream textStream; | ||
std::istream mapStream(&file->getInputStream()); | ||
textStream << mapStream.rdbuf(); | ||
textStream.flush(); | ||
|
||
return textStream.str(); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Version 2 | ||
// entity 0 | ||
{ | ||
"classname" "worldspawn" | ||
} | ||
// entity 1 | ||
{ | ||
"classname" "missing_entityclass" | ||
"name" "missing_entityclass_1" | ||
"model" "missing_entityclass_1" | ||
"origin" "144 32 0" | ||
// primitive 0 | ||
{ | ||
brushDef3 | ||
{ | ||
( 0 0 1 -64 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 -1 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 1 0 -80 ) ( ( 0.015625 0 1 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( 1 0 0 -80 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 0 -1 -64 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 1 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 -1 0 0 ) ( ( 0.015625 0 -1 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( -1 0 0 0 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 -2.220446049250313e-16 ) ) "textures/common/caulk" 0 0 0 | ||
} | ||
} | ||
// primitive 1 | ||
{ | ||
brushDef3 | ||
{ | ||
( 0 0 1 -64 ) ( ( 0.015625 0 4.440892098500626e-16 ) ( 0 0.015625 0.25 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 1 0 -80 ) ( ( 0.015625 0 -0.25 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( 1 0 0 0 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 0 -1 -64 ) ( ( 0.015625 0 3.33066907387547e-16 ) ( 0 0.015625 -0.25 ) ) "textures/common/caulk" 0 0 0 | ||
( 0 -1 0 0 ) ( ( 0.015625 0 0.25 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0 | ||
( -1 0 0 -80 ) ( ( 0.015625 0 -1.110223024625157e-16 ) ( 0 0.015625 -4.440892098500626e-16 ) ) "textures/common/caulk" 0 0 0 | ||
} | ||
} | ||
// primitive 2 | ||
{ | ||
patchDef2 | ||
{ | ||
"textures/common/caulk" | ||
( 3 3 0 0 0 ) | ||
( | ||
( ( 112 -48 0 0 0 ) ( 112 -8 0 0 -0.625 ) ( 112 32 0 0 -1.25 ) ) | ||
( ( 152 -48 0 0.625 0 ) ( 152 -8 0 0.625 -0.625 ) ( 152 32 0 0.625 -1.25 ) ) | ||
( ( 192 -48 0 1.25 0 ) ( 192 -8 0 1.25 -0.625 ) ( 192 32 0 1.25 -1.25 ) ) | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters