-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathCommon.cpp
40 lines (30 loc) · 838 Bytes
/
Common.cpp
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
//#include "stdafx.h"
#include "Common.h"
#include <cryptoTools/Common/Log.h>
#include <fstream>
#include <cassert>
using namespace osuCrypto;
namespace tests_cryptoTools
{
static std::fstream* file = nullptr;
std::string SolutionDir = "../..";
void InitDebugPrinting(std::string filePath)
{
std::cout << "changing sink" << std::endl;
if (file == nullptr)
{
file = new std::fstream;
}
else
{
file->close();
}
file->open(filePath, std::ios::trunc | std::ofstream::out);
if (!file->is_open())
throw UnitTestFail();
//time_t now = time(0);
std::cout.rdbuf(file->rdbuf());
std::cerr.rdbuf(file->rdbuf());
//Log::SetSink(*file);
}
}