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,
|
2019-10-27 12:57:47 +00:00
|
|
|
aiDefaultLogStream_STDOUT | 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
|
|
|
}
|