-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (40 loc) · 1 KB
/
main.cpp
File metadata and controls
54 lines (40 loc) · 1 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// #include "info.h"
#include "data.h"
#include "rfile.h"
#include "test.h"
#include <gtest/gtest.h>
#include <iostream>
// #include <string>
#include <vector>
#include <climits>
#include <numeric>
#include <algorithm>
// #include <stack>
using namespace std;
// void print(int a, const int& b) {
// std::cout << a << " " << b << std::endl;
// }
TEST(isprimes, test1) {
std::vector<int> test;
getData(test);
std::vector<bool> expected = {true, true, true, false, false, true, false, false};
for (size_t i = 0; i < test.size(); ++i) {
EXPECT_EQ(isprimes(test[i]), expected[i]) << "Test failed for input: " << i;
}
}
int main() {
::testing::InitGoogleTest();
return RUN_ALL_TESTS();
RFile rf;
rf.open();
vector<int> v1, v2, res(10);
rf.getData(v1);
rf.getData(v2);
std::transform(v1.begin(), v1.end(), v2.begin(), res.begin(), [](int a, int b) {
return a + b;
});
printRes(v1);
printRes(v2);
printRes(res);
return 0;
}