-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest_xaxes.cpp
More file actions
50 lines (42 loc) Β· 1.7 KB
/
test_xaxes.cpp
File metadata and controls
50 lines (42 loc) Β· 1.7 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
/***************************************************************************
* 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/xaxes.hpp"
namespace xpl
{
TEST(xaxis, constructor)
{
linear_scale s1;
s1.mid_range = 0.9;
axis a1(s1);
EXPECT_DOUBLE_EQ(a1.scale().get<linear_scale>().mid_range, s1.mid_range);
linear_scale s2;
s2.mid_range = 0.9;
axis a2(std::move(s2));
EXPECT_DOUBLE_EQ(a2.scale().get<linear_scale>().mid_range, s1.mid_range);
auto s3 = std::make_shared<linear_scale>();
s3->mid_range = 0.9;
axis a3(s3);
EXPECT_DOUBLE_EQ(a3.scale().get<linear_scale>().mid_range, s3->mid_range);
}
TEST(xcolor_axis, constructor)
{
linear_scale s1;
s1.mid_range = 0.9;
color_axis a1(s1);
EXPECT_DOUBLE_EQ(a1.scale().get<linear_scale>().mid_range, s1.mid_range);
linear_scale s2;
s2.mid_range = 0.9;
color_axis a2(std::move(s2));
EXPECT_DOUBLE_EQ(a2.scale().get<linear_scale>().mid_range, s1.mid_range);
auto s3 = std::make_shared<linear_scale>();
s3->mid_range = 0.9;
color_axis a3(s3);
EXPECT_DOUBLE_EQ(a3.scale().get<linear_scale>().mid_range, s3->mid_range);
}
}