瀏覽代碼

Unittests: add validation for TestIOSystem parameters.

Kim Kulling 8 年之前
父節點
當前提交
1a8b23712e
共有 1 個文件被更改,包括 14 次插入4 次删除
  1. 14 4
      test/unit/TestIOSystem.h

+ 14 - 4
test/unit/TestIOSystem.h

@@ -3,7 +3,7 @@
 Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2016, assimp team
+Copyright (c) 2006-2017, assimp team
 
 All rights reserved.
 
@@ -45,12 +45,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <assimp/IOSystem.hpp>
 
 using namespace std;
-using namespace Assimp;
+
+namespace Assimp {
 
 static const string Sep = "/";
+
 class TestIOSystem : public IOSystem {
 public:
-    TestIOSystem() : IOSystem() {}
+    TestIOSystem()
+        : IOSystem() {
+        // empty
+    }
+
     virtual ~TestIOSystem() {}
     virtual bool Exists( const char* ) const {
         return true;
@@ -60,10 +66,14 @@ public:
     }
 
     virtual IOStream* Open( const char* pFile, const char* pMode = "rb" ) {
+        EXPECT_NE( nullptr, pFile );
+        EXPECT_NE( nullptr, pMode );
         return NULL;
     }
 
     virtual void Close( IOStream* pFile ) {
-        // empty
+        EXPECT_NE( nullptr, pFile );
     }
 };
+
+} // Namespace Assimp