-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.cpp
More file actions
41 lines (32 loc) · 950 Bytes
/
core.cpp
File metadata and controls
41 lines (32 loc) · 950 Bytes
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
33
34
35
36
37
38
39
40
41
#include <q-tee/common/common.h>
#ifdef Q_OS_WINDOWS
#define _CRT_SECURE_NO_WARNINGS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif
#include <iomanip>
#include "units/crt.h"
#include "units/hash.h"
int main()
{
#ifdef Q_OS_WINDOWS
const HANDLE hOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
if (hOutput == INVALID_HANDLE_VALUE)
return EXIT_FAILURE;
// enable virtual terminal to support ANSI escape-codes
if (DWORD dwConsoleMode = 0UL; !::GetConsoleMode(hOutput, &dwConsoleMode) || !::SetConsoleMode(hOutput, dwConsoleMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING))
return EXIT_FAILURE;
::SetConsoleOutputCP(CP_UTF8);
#endif
CUnitTest hash("HASH");
hash.Add(UNIT::HASH::Assert(), true);
hash.Add(UNIT::HASH::AssertConst(), true);
hash.Report();
CUnitTest crt("CRT");
crt.Add(UNIT::CRT::Assert(), true);
crt.Add(UNIT::CRT::AssertConst(), true);
crt.Report();
return EXIT_SUCCESS;
}