added unittest to main recipe, removed debug couts

This commit is contained in:
suhrke 2017-07-05 19:53:09 -07:00
parent 802f0bc99a
commit 774688180d
2 changed files with 1 additions and 6 deletions

View File

@ -4,7 +4,7 @@ CFLAGS=-std=c++11 -I"./includes" -I"./includes/Catch/single_include" -I"./includ
TESTEX=test/test-parser TESTEX=test/test-parser
UNITEX=test/catch UNITEX=test/catch
all: main all: main unittest
main: planes.o brushdef.o oopless-parser.o EntityConverter.o main: planes.o brushdef.o oopless-parser.o EntityConverter.o
$(CC) $^ main.cpp $(CFLAGS) -o $(EX) 2>error8.log $(CC) $^ main.cpp $(CFLAGS) -o $(EX) 2>error8.log

View File

@ -142,23 +142,18 @@ EntityConverter::convert(std::vector<std::string> lines)
for ( int i = 1; i < lines.size(); ++i ) { for ( int i = 1; i < lines.size(); ++i ) {
// only works for maps that support race AND other modes // only works for maps that support race AND other modes
if ( lines[i].find("modeRace 0") != std::string::npos) { if ( lines[i].find("modeRace 0") != std::string::npos) {
std::cout << "disabled race because worldspawn" << std::endl;
mapinfo_.cts = false; mapinfo_.cts = false;
} }
else if ( lines[i].find("modeCTF 0") != std::string::npos) { else if ( lines[i].find("modeCTF 0") != std::string::npos) {
std::cout << "disabled ctf because worldspawn" << std::endl;
mapinfo_.ctf = false; mapinfo_.ctf = false;
} }
else if ( lines[i].find("modeFFA 0") != std::string::npos) { else if ( lines[i].find("modeFFA 0") != std::string::npos) {
std::cout << "disabled ffa because worldspawn" << std::endl;
mapinfo_.ffa = false; mapinfo_.ffa = false;
} }
else if ( lines[i].find("modeTDM 0") != std::string::npos) { else if ( lines[i].find("modeTDM 0") != std::string::npos) {
std::cout << "disabled tdm because worldspawn" << std::endl;
mapinfo_.tdm = false; mapinfo_.tdm = false;
} }
else if ( lines[i].find("mode1v1 0") != std::string::npos) { else if ( lines[i].find("mode1v1 0") != std::string::npos) {
std::cout << "disabled duel because worldspawn" << std::endl;
mapinfo_.duel = false; mapinfo_.duel = false;
} }
} }