Mercurial > malikania
comparison tests/libclient/point/main.cpp @ 42:a47a4477f347
Misc: new style, closes #578
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 29 Nov 2016 21:21:36 +0100 |
parents | d4f5f7231b84 |
children | fabbe1759cec |
comparison
equal
deleted
inserted
replaced
41:3645200f46bf | 42:a47a4477f347 |
---|---|
1 /* | 1 /* |
2 * main.cpp -- test Point | 2 * main.cpp -- test mlk::point |
3 * | 3 * |
4 * Copyright (c) 2013-2016 Malikania Authors | 4 * Copyright (c) 2013-2016 Malikania Authors |
5 * | 5 * |
6 * Permission to use, copy, modify, and/or distribute this software for any | 6 * Permission to use, copy, modify, and/or distribute this software for any |
7 * purpose with or without fee is hereby granted, provided that the above | 7 * purpose with or without fee is hereby granted, provided that the above |
18 | 18 |
19 #include <gtest/gtest.h> | 19 #include <gtest/gtest.h> |
20 | 20 |
21 #include <malikania/point.hpp> | 21 #include <malikania/point.hpp> |
22 | 22 |
23 using namespace malikania; | 23 namespace mlk = malikania; |
24 | 24 |
25 TEST(Basics, none) | 25 TEST(Basics, none) |
26 { | 26 { |
27 Point point; | 27 mlk::point point; |
28 | 28 |
29 ASSERT_EQ(0, point.x()); | 29 ASSERT_EQ(0, point.x()); |
30 ASSERT_EQ(0, point.y()); | 30 ASSERT_EQ(0, point.y()); |
31 } | 31 } |
32 | 32 |
33 TEST(Basics, standard) | 33 TEST(Basics, standard) |
34 { | 34 { |
35 Point point(10, 20); | 35 mlk::point point(10, 20); |
36 | 36 |
37 ASSERT_EQ(10, point.x()); | 37 ASSERT_EQ(10, point.x()); |
38 ASSERT_EQ(20, point.y()); | 38 ASSERT_EQ(20, point.y()); |
39 } | 39 } |
40 | 40 |
41 TEST(Basics, operatorEq) | 41 TEST(Basics, operatorEq) |
42 { | 42 { |
43 Point point1, point2; | 43 mlk::point point1, point2; |
44 | 44 |
45 ASSERT_EQ(point1, point2); | 45 ASSERT_EQ(point1, point2); |
46 } | 46 } |
47 | 47 |
48 TEST(Basics, operatorEq1) | 48 TEST(Basics, operatorEq1) |
49 { | 49 { |
50 Point point1(10, 20); | 50 mlk::point point1(10, 20); |
51 Point point2(10, 20); | 51 mlk::point point2(10, 20); |
52 | 52 |
53 ASSERT_EQ(point1, point2); | 53 ASSERT_EQ(point1, point2); |
54 } | 54 } |
55 | 55 |
56 TEST(Basics, operatorNeq) | 56 TEST(Basics, operatorNeq) |
57 { | 57 { |
58 ASSERT_NE(Point(10), Point(20)); | 58 ASSERT_NE(mlk::point(10), mlk::point(20)); |
59 ASSERT_NE(Point(10, 10), Point(10, 20)); | 59 ASSERT_NE(mlk::point(10, 10), mlk::point(10, 20)); |
60 } | 60 } |
61 | 61 |
62 int main(int argc, char **argv) | 62 int main(int argc, char **argv) |
63 { | 63 { |
64 testing::InitGoogleTest(&argc, argv); | 64 testing::InitGoogleTest(&argc, argv); |