8000 Tests now compile. Also added entries to gitignore for generated · randomcoding/PSAI-MessageRelay@89b56eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 89b56eb

Browse files
committed
Tests now compile. Also added entries to gitignore for generated
artefacts.
1 parent adebd76 commit 89b56eb

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

.cproject

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.1342493057." name="/" resourcePath="">
2929
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.147699127" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
3030
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1962868766" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
31-
<builder buildPath="${workspace_loc:/PsaiMessageRedirector/}" command="jam" id="cdt.managedbuild.target.gnu.builder.exe.release.777111791" incrementalBuildTarget="-q -s CRYSTAL.DIR=${CRYSTAL_BASE_DIR} CAL3D.DIR=${CAL3D_BASE_DIR} PS.DIR=${PS_BASE_DIR} GTEST.DIR=${GTEST_BASE_DIR} all" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
31+
<builder buildPath="${workspace_loc:/PsaiMessageRedirector/}" command="jam" id="cdt.managedbuild.target.gnu.builder.exe.release.777111791" incrementalBuildTarget="-q -sCRYSTAL.DIR=${CRYSTAL_BASE_DIR} -sCAL3D.DIR=${CAL3D_BASE_DIR} -sPS.DIR=${PS_BASE_DIR} -sGTEST.DIR=${GTEST_BASE_DIR} all" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
3232
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1804326035" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
3333
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1944722990" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
3434
<option id="gnu.cpp.compiler.exe.release.option.optimization.level.18046520" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
@@ -51,6 +51,7 @@
5151
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
5252
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
5353
<listOptionValue builtIn="false" value="/usr/include"/>
54+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
5455
</option>
5556
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.830716654" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
5657
</tool>
@@ -75,6 +76,7 @@
7576
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
7677
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
7778
<listOptionValue builtIn="false" value="/usr/include"/>
79+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
7880
</option>
7981
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1363997412" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
8082
</tool>
@@ -107,6 +109,7 @@
107109
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
108110
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
109111
<listOptionValue builtIn="false" value="/usr/include"/>
112+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
110113
</option>
111114
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.173137458" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
112115
</tool>
@@ -167,6 +170,7 @@
167170
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/tools&quot;"/>
168171
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
169172
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
173+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
170174
</option>
171175
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.830660026" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
172176
</tool>
@@ -190,6 +194,7 @@
190194
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/tools&quot;"/>
191195
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
192196
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
197+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
193198
</option>
194199
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1412295669" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
195200
</tool>
@@ -221,6 +226,7 @@
221226
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/tools&quot;"/>
222227
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
223228
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
229+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
224230
</option>
225231
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1216851677" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
226232
</tool>
@@ -259,7 +265,7 @@
259265
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.1342493057.1178637835." name="/" resourcePath="">
260266
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.404744936" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
261267
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1527895145" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
262-
<builder buildPath="${workspace_loc:/PsaiMessageRedirector/}" command="jam" id="cdt.managedbuild.target.gnu.builder.exe.release.1137324904" incrementalBuildTarget="-q -s CRYSTAL.DIR=${CRYSTAL_BASE_DIR} CAL3D.DIR=${CAL3D_BASE_DIR} PS.DIR=${PS_BASE_DIR} GTEST.DIR=${GTEST_BASE_DIR} tests" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
268+
<builder buildPath="${workspace_loc:/PsaiMessageRedirector/}" command="jam" id="cdt.managedbuild.target.gnu.builder.exe.release.1137324904" incrementalBuildTarget="-q -sCRYSTAL.DIR=${CRYSTAL_BASE_DIR} -sCAL3D.DIR=${CAL3D_BASE_DIR} -sPS.DIR=${PS_BASE_DIR} -sGTEST.DIR=${GTEST_BASE_DIR} tests" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
263269
<tool id="cdt.managedbuild.tool.gnu.archiver.base.283097247" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
264270
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1938551756" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
265271
<option id="gnu.cpp.compiler.exe.release.option.optimization.level.1896136281" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
@@ -282,6 +288,7 @@
282288
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
283289
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
284290
<listOptionValue builtIn="false" value="/usr/include"/>
291+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
285292
</option>
286293
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.288720193" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
287294
</tool>
@@ -306,6 +313,7 @@
306313
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
307314
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
308315
<listOptionValue builtIn="false" value="/usr/include"/>
316+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
309317
</option>
310318
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.493726617" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
311319
</tool>
@@ -338,6 +346,7 @@
338346
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/worldeditor&quot;"/>
339347
<listOptionValue builtIn="false" value="&quot;${PS_BASE_DIR}/src/npcclient&quot;"/>
340348
<listOptionValue builtIn="false" value="/usr/include"/>
349+
<listOptionValue builtIn="false" value="&quot;${GTEST_BASE_DIR}/include&quot;"/>
341350
</option>
342351
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.472908253" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
343352
</tool>

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/out
2+
*.[oa]
3+
*.so
4+
*.dbg
5+
psaitests

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</dictionary>
5656
<dictionary>
5757
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
58-
<value>-q -sCRYSTAL.DIR=${CRYSTAL_BASE_DIR} -sCAL3D.DIR=${CAL3D_BASE_DIR} -sPS.DIR=${PS_BASE_DIR} -sGTEST.DIR=${GTEST_BASE_DIR} psailib</value>
58+
<value>-q -sCRYSTAL.DIR=${CRYSTAL_BASE_DIR} -sCAL3D.DIR=${CAL3D_BASE_DIR} -sPS.DIR=${PS_BASE_DIR} -sGTEST.DIR=${GTEST_BASE_DIR} tests</value>
5959
</dictionary>
6060
<dictionary>
6161
<key>org.eclipse.cdt.make.core.stopOnError</key>

Jamconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ COMPILER.CFLAGS.VISIBILITY_DEFAULT ?= -fvisibility=default ;
5050
# set this to debug or optimize depending on whether or not you configured PlaneShift with debug or not
5151
PS.BUILD.TYPE ?= optimize ;
5252

53+
# set the version of the Crystal Space library.
54+
CS.VERSION ?= 2.1 ;
55+
5356
CRYSTAL.AVAILABLE ?= yes ;
5457
CRYSTAL.VERSION ?= 1.4 ;
5558
CRYSTAL.CFLAGS ?= -I$(CRYSTAL.DIR)/include ;
56-
CRYSTAL.LFLAGS ?= -L$(CRYSTAL.DIR)/out/linux/optimize/libs -lcrystalspace-1.9 -lz -lpthread -lc -lm -ldl -lnsl -L/usr/local/lib ;
59+
CRYSTAL.LFLAGS ?= -L$(CRYSTAL.DIR)/out/linux/optimize/libs -lcrystalspace-$(CS.VERSION) -lz -lpthread -lc -lm -ldl -lnsl -L/usr/local/lib ;
5760
CRYSTAL.INCLUDE_DIR ?= $(CRYSTAL.DIR)/include ;
5861
CRYSTAL.AVAILABLE_LIBS ?= crystalspace crystalspace_opengl ;
5962
CRYSTAL.STATICDEPS ?= $(CRYSTAL.DIR)/pace/out/linux/optimize/libs/crystalspace_staticplugins.jam ;

Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ IncludeDir tests xml ;
2626
IncludeDir $(TOP) .. cal3d src ;
2727
IncludeDir $(TOP) .. cal3d include ;
2828
IncludeDir $(TOP) .. crystalspace include ;
29+
IncludeDir $(GTEST.INCLUDE_DIR) ;
2930

3031
# PlaneShift include directories
3132
IncludeDir $(TOP) .. planeshift include ;

tests/XmlGeneratorTests.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <cssysdef.h>
9+
#include <psconfig.h>
910
#include <cstring>
1011
#include <csutil/strhashr.h>
1112
#include <iutil/objreg.h>
@@ -82,7 +83,7 @@ class XmlGeneratorTest: public testing::Test
8283
static String equipmentParts;
8384
static uint8_t counter;
8485
static EID mappedEid;
85-
static csStringHashReversible* msgStringsHashReversable;
86+
//static csStringHashReversible* msgStringsHashReversable;
8687
static psLinearMovement* linearMovement;
8788
static uint8_t movementMode;
8889
static uint8_t serverMode;
@@ -114,6 +115,8 @@ class XmlGeneratorTest: public testing::Test
114115
static int attackAnimation;
115116
static int defenseAnimation;
116117

118+
static NetBase::AccessPointers* accessPointers;
119+
117120
protected:
118121
// no set up yet
119122

@@ -417,6 +420,8 @@ float XmlGeneratorTest::defaultYRotation = 34.5;
417420
float XmlGeneratorTest::defaultZRotation = 54.3;
418421
EID XmlGeneratorTest::objectEid(44);
419422

423+
NetBase::AccessPointers* XmlGeneratorTest::accessPointers = new NetBase::AccessPointers();
424+
420425
// persist actor message
421426
int XmlGeneratorTest::actorType = 98;
422427
int XmlGeneratorTest::masqueradeType = 45;
@@ -438,7 +443,7 @@ String XmlGeneratorTest::texParts("Tex Parts");
438443
String XmlGeneratorTest::equipmentParts("Equipment Parts");
439444
uint8_t XmlGeneratorTest::counter = 2;
440445
EID XmlGeneratorTest::mappedEid(43);
441-
csStringHashReversible* XmlGeneratorTest::msgStringsHashReversable = new csStringHashReversible(10);
446+
//csStringHashReversible* XmlGeneratorTest::msgStringsHashReversable = new csStringHashReversible(10);
442447
uint8_t XmlGeneratorTest::movementMode = 5;
443448
uint8_t XmlGeneratorTest::serverMode = 3;
444449
PID XmlGeneratorTest::playerId(123);
@@ -527,8 +532,10 @@ TEST_F(XmlGeneratorTest, testPersistItemMessageToXml)
527532
TEST_F(XmlGeneratorTest, DISABLED_testPersistActorMessageToXml)
528533
{
529534
psLinearMovement* linearMove = createLinearMovement();
535+
float scale = 1.0;
536+
float mountScale = 1.0;
530537
psPersistActor msg(defaultClientNum, actorType, masqueradeType, control, actorName.c_str(), guildName.c_str(), factionName.c_str(),
531-
matName.c_str(), raceName.c_str(), mountFactionName.c_str(), mounterAnim.c_str(), gender, helmGroup.c_str(), bracerGroup.c_str(),
538+
matName.c_str(), raceName.c_str(), mountFactionName.c_str(), mounterAnim.c_str(), gender, scale, mountScale, helmGroup.c_str(), bracerGroup.c_str(),
532539
beltGroup.c_str(), cloakGroup.c_str(), collisionTop, collisionBottom, collisionOffset, texParts.c_str(), equipmentParts.c_str(), counter,
533540
mappedEid, msgStrings, linearMove, movementMode, serverMode, playerId, groupId, ownerEid, persistActorMessageFlags);
534541

@@ -587,8 +594,7 @@ TEST_F(XmlGeneratorTest, testRemoveObjectMessageToXml)
587594
// Disabled for the same reason as testPersistActorMessageToXml
588595
TEST_F(XmlGeneratorTest, DISABLED_testDeadReckoningMessageToXml)
589596
{
590-
psDRMessage msg(defaultClientNum, mappedEid, true, movementMode, counter, position, yRot, iSec, sector.c_str(), velocity, worldVelocity,
591-
ang_velocity, msgStrings, msgStringsHashReversable);
597+
psDRMessage msg(defaultClientNum, mappedEid, true, movementMode, counter, position, yRot, iSec, sector.c_str(), velocity, worldVelocity, ang_velocity, accessPointers);
592598

593599
msg.entityid = mappedEid;
594600
msg.on_ground = true;

0 commit comments

Comments
 (0)
0