-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
43 lines (34 loc) · 742 Bytes
/
Copy pathtest.cpp
File metadata and controls
43 lines (34 loc) · 742 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
42
43
//
// Created by meox on 20/08/16.
//
#include <iostream>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include "util.h"
#include <gtest/gtest.h>
TEST(partions, check_size)
{
std::set<int> s{1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11};
for (uint32_t i = 1; i < s.size(); i++)
{
auto r = kutil::partions(s, i);
ASSERT_EQ(r.size(), i);
}
}
TEST(partions, check_tot_size)
{
std::set<int> s{1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11};
auto r = kutil::partions(s, 5);
uint tot{};
for (auto& x : r)
tot += x.size();
ASSERT_EQ(tot, s.size());
}
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}