assimp/test/unit/Main.cpp

34 lines
1.0 KiB
C++
Raw Normal View History

2015-04-15 23:00:17 +00:00
#include "UnitTestPCH.h"
#include "../../include/assimp/DefaultLogger.hpp"
2015-05-19 04:24:07 +00:00
#include <math.h>
#include <time.h>
int main(int argc, char* argv[])
{
2015-05-19 04:26:05 +00:00
::testing::InitGoogleTest(&argc, argv);
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
// seed the randomizer with the current system time
time_t t;time(&t);
srand((unsigned int)t);
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
// ............................................................................
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
// create a logger from both CPP
Assimp::DefaultLogger::create("AssimpLog_Cpp.txt",Assimp::Logger::VERBOSE,
aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE);
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
// .. and C. They should smoothly work together
aiEnableVerboseLogging(AI_TRUE);
aiLogStream logstream= aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.txt");
aiAttachLogStream(&logstream);
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
int result = RUN_ALL_TESTS();
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
// ............................................................................
// but shutdown must be done from C to ensure proper deallocation
aiDetachAllLogStreams();
2015-05-19 04:24:07 +00:00
2015-05-19 04:26:05 +00:00
return result;
2015-05-19 04:24:07 +00:00
}