From 293654fe7ca37ece540cbf756f490b321669c62a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Oct 2016 08:55:11 +0100 Subject: [PATCH] Fix unittest. --- code/BlenderLoader.h | 1 - code/DefaultIOStream.h | 12 ++++++------ code/glTFExporter.cpp | 4 ++-- test/unit/TestIOStream.h | 2 +- test/unit/utIOStreamBuffer.cpp | 6 +++--- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/code/BlenderLoader.h b/code/BlenderLoader.h index c964eee32..505409260 100644 --- a/code/BlenderLoader.h +++ b/code/BlenderLoader.h @@ -105,7 +105,6 @@ public: BlenderImporter(); ~BlenderImporter(); - public: // -------------------- diff --git a/code/DefaultIOStream.h b/code/DefaultIOStream.h index ecca1a79b..017f33f67 100644 --- a/code/DefaultIOStream.h +++ b/code/DefaultIOStream.h @@ -78,14 +78,14 @@ public: /// Read from stream size_t Read(void* pvBuffer, size_t pSize, - size_t pCount); + size_t pCount) override; // ------------------------------------------------------------------- /// Write to stream size_t Write(const void* pvBuffer, size_t pSize, - size_t pCount); + size_t pCount) override; // ------------------------------------------------------------------- /// Seek specific position @@ -94,18 +94,18 @@ public: // ------------------------------------------------------------------- /// Get current seek position - size_t Tell() const; + size_t Tell() const override; // ------------------------------------------------------------------- /// Get size of file - size_t FileSize() const; + size_t FileSize() const override; // ------------------------------------------------------------------- /// Flush file contents - void Flush(); + void Flush() override; private: - // File datastructure, using clib + // File data-structure, using clib FILE* mFile; // Filename std::string mFilename; diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 07d8f8c23..f2203929c 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -447,7 +447,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aim, Ref& meshRef, RefjointNames.size(); ++idx_joint) { + for ( unsigned int idx_joint = 0; idx_joint < skinRef->jointNames.size(); ++idx_joint) { if (skinRef->jointNames[idx_joint]->jointName.compare(nodeRef->jointName) == 0) { addJointToJointNames = false; jointNamesIndex = idx_joint; @@ -732,7 +732,7 @@ void glTFExporter::ExportMeshes() // Create the Accessor for skinRef->inverseBindMatrices if (createSkin) { mat4* invBindMatrixData = new mat4[inverseBindMatricesData.size()]; - for (int idx_joint = 0; idx_joint < inverseBindMatricesData.size(); ++idx_joint) { + for ( unsigned int idx_joint = 0; idx_joint < inverseBindMatricesData.size(); ++idx_joint) { CopyValue(inverseBindMatricesData[idx_joint], invBindMatrixData[idx_joint]); } diff --git a/test/unit/TestIOStream.h b/test/unit/TestIOStream.h index 974fa68cd..a979caec8 100644 --- a/test/unit/TestIOStream.h +++ b/test/unit/TestIOStream.h @@ -51,7 +51,7 @@ public: } TestDefaultIOStream( FILE* pFile, const std::string &strFilename ) - : DefaultIOStream( pFile, strFilename ) { + : DefaultIOStream( pFile, strFilename ) { // empty } diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp index d139cfbec..a6308fc7d 100644 --- a/test/unit/utIOStreamBuffer.cpp +++ b/test/unit/utIOStreamBuffer.cpp @@ -97,10 +97,10 @@ TEST_F( IOStreamBufferTest, readlineTest ) { EXPECT_EQ( 26, myBuffer.cacheSize() ); TestDefaultIOStream myStream( fs, buffer ); - + size_t size( myStream.FileSize() ); + size_t numBlocks( size / myBuffer.cacheSize() ); EXPECT_TRUE( myBuffer.open( &myStream ) ); - - EXPECT_EQ( 10, myBuffer.getNumBlocks() ); + EXPECT_EQ( numBlocks, myBuffer.getNumBlocks() ); EXPECT_TRUE( myBuffer.close() ); }