-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
31 lines (29 loc) · 956 Bytes
/
test.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
#include "priceallocator.h"
#include "gtest/gtest.h"
TEST(PATest, Test1)
{
PriceAllocator allocator = PriceAllocator(50, 2, MEAN, 10);
vector<int> a{1000, 2000, 3000};
vector<int> bq{3000, 3000};
vector<double> bp{100, 101, 102, 103, 104};
vector<vector<int>> m{{1, 1},
{1, 1},
{1, 1}};
allocator.setInput(a, bq, bp, m);
allocator.run();
}
TEST(PATest, Test2)
{
PriceAllocator allocator = PriceAllocator(50, 2, MEAN, 10);
vector<int> a{1000, 2000, 3000, 1000, 2000, 3000};
vector<int> bq{2000, 2000, 5000, 5000};
vector<double> bp{100, 101, 102, 103, 104};
vector<vector<int>> m{{0, 1, 1, 1},
{1, 0, 1, 1},
{1, 1, 0, 1},
{1, 1, 1, 0},
{1, 1, 1, 1},
{1, 1, 1, 1}};
allocator.setInput(a, bq, bp, m);
allocator.run();
}