-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtest_xmarks.cpp
44 lines (38 loc) · 1.51 KB
/
test_xmarks.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
41
42
43
44
/***************************************************************************
* Copyright (c) 2016, Johan Mabille and Sylvain Corlay *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#include "gtest/gtest.h"
#include "xplot/xmarks.hpp"
namespace xpl
{
TEST(xmarks, constructor)
{
linear_scale sx1, sy1;
sx1.mid_range = 0.9;
sy1.mid_range = 0.87;
lines l1(sx1, sy1);
EXPECT_EQ(l1.scales()["x"].get<linear_scale>().mid_range(), 0.9);
EXPECT_EQ(l1.scales()["y"].get<linear_scale>().mid_range(), 0.87);
linear_scale sx2, sy2;
sx2.mid_range = 0.9;
sy2.mid_range = 0.87;
lines l2(std::move(sx2), std::move(sy2));
EXPECT_EQ(l2.scales()["x"].get<linear_scale>().mid_range(), 0.9);
EXPECT_EQ(l2.scales()["y"].get<linear_scale>().mid_range(), 0.87);
auto sx3 = std::make_shared<linear_scale>();
sx3->mid_range = 0.9;
lines l3(sx3, sx3);
EXPECT_EQ(l3.scales()["x"].id(), l3.scales()["y"].id());
}
TEST(xmarks, lines)
{
linear_scale sx, sy;
lines line(sx, sy);
int res = line.marker_size();
EXPECT_EQ(64, res);
}
}