-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram_test.cpp
More file actions
29 lines (27 loc) · 1.07 KB
/
Copy pathprogram_test.cpp
File metadata and controls
29 lines (27 loc) · 1.07 KB
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
#include "program.h"
#include "gtest/gtest.h"
#include "log.h"
TEST(Program, Test1) {
standartLog->info("Console already");
Log logFile("logs/program.txt", {"build", "process"});
logFile.setFileLevel(spdlog::level::level_enum::trace);
auto logBuild = logFile.get("build");
logBuild->set_level(spdlog::level::trace);
logBuild->info("Pre-start program on the input : {}", "input.txt");
Program<32> program("input.txt", logBuild);
auto logProcess = logFile.get("process");
program.process(logProcess);
EXPECT_EQ(program.outputData(), 281);
}
TEST(Program, Test2) {
standartLog->info("Console already");
Log logFile("logs/program2.txt", {"build", "process"});
logFile.setFileLevel(spdlog::level::level_enum::trace);
auto logBuild = logFile.get("build");
logBuild->set_level(spdlog::level::trace);
logBuild->info("Pre-start program on the input : {}", "input.txt");
Program<32> program("input2.txt", logBuild);
auto logProcess = logFile.get("process");
program.process(logProcess);
EXPECT_EQ(program.outputData(), 9);
}