Fix unittest.
authorKim Kulling <kim.kulling@googlemail.com>
Sun, 30 Oct 2016 07:55:11 +0000 (08:55 +0100)
committerKim Kulling <kim.kulling@googlemail.com>
Sun, 30 Oct 2016 07:55:11 +0000 (08:55 +0100)
code/BlenderLoader.h
code/DefaultIOStream.h
code/glTFExporter.cpp
test/unit/TestIOStream.h
test/unit/utIOStreamBuffer.cpp

index c964eee..5054092 100644 (file)
@@ -105,7 +105,6 @@ public:
     BlenderImporter();
     ~BlenderImporter();
 
-
 public:
 
     // --------------------
index ecca1a7..017f33f 100644 (file)
@@ -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;
index 07d8f8c..f220392 100644 (file)
@@ -447,7 +447,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aim, Ref<Mesh>& meshRef, Ref<Buffer
 
         unsigned int jointNamesIndex;
         bool addJointToJointNames = true;
-        for (int idx_joint = 0; idx_joint < skinRef->jointNames.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]);
         }
 
index 974fa68..a979cae 100644 (file)
@@ -51,7 +51,7 @@ public:
     }
 
     TestDefaultIOStream( FILE* pFile, const std::string &strFilename )
-        : DefaultIOStream( pFile, strFilename ) {
+    : DefaultIOStream( pFile, strFilename ) {
         // empty
     }
 
index d139cfb..a6308fc 100644 (file)
@@ -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() );
 }