File: Main.cpp

package info (click to toggle)
assimp 5.4.3%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 100,104 kB
  • sloc: cpp: 164,162; cobol: 65,664; ansic: 16,520; xml: 11,246; python: 5,311; java: 2,303; sh: 398; objc: 122; pascal: 100; makefile: 66
file content (32 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "../../include/assimp/DefaultLogger.hpp"
#include "UnitTestPCH.h"
#include <math.h>
#include <time.h>

int main(int argc, char *argv[]) {
    ::testing::InitGoogleTest(&argc, argv);

    // seed the randomizer with the current system time
    time_t t;
    time(&t);
    srand((unsigned int)t);

    // ............................................................................

    // create a logger from both CPP
    Assimp::DefaultLogger::create("AssimpLog_Cpp.txt", Assimp::Logger::VERBOSE,
            aiDefaultLogStream_STDOUT | aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE);

    // .. and C. They should smoothly work together
    aiEnableVerboseLogging(AI_TRUE);
    aiLogStream logstream = aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.txt");
    aiAttachLogStream(&logstream);

    int result = RUN_ALL_TESTS();

    // ............................................................................
    // but shutdown must be done from C to ensure proper deallocation
    aiDetachAllLogStreams();

    return result;
}