2 Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "vertical_position.h"
21 #include <boost/test/unit_test.hpp>
23 using boost::optional;
25 /* Test operator< for VerticalPosition */
26 BOOST_AUTO_TEST_CASE (vertical_position_test)
28 sub::VerticalPosition a;
29 sub::VerticalPosition b;
34 a.reference = sub::TOP_OF_SCREEN;
36 b.reference = sub::TOP_OF_SCREEN;
40 a.reference = sub::TOP_OF_SCREEN;
42 b.reference = sub::TOP_OF_SCREEN;
45 a.proportional = optional<float> ();
46 b.proportional = optional<float> ();
50 a.reference = sub::TOP_OF_SCREEN;
53 b.reference = sub::TOP_OF_SCREEN;
58 a.reference = sub::TOP_OF_SCREEN;
61 b.reference = sub::TOP_OF_SCREEN;
64 /* Different reference points with proportional */
66 a.line = optional<int> ();
67 a.lines = optional<int> ();
68 b.line = optional<int> ();
69 b.lines = optional<int> ();
72 a.reference = sub::TOP_OF_SCREEN;
74 b.reference = sub::VERTICAL_CENTRE_OF_SCREEN;
78 a.reference = sub::BOTTOM_OF_SCREEN;
80 b.reference = sub::TOP_OF_SCREEN;
83 /* Different line counts with lines */
85 a.proportional = optional<float> ();
86 b.proportional = optional<float> ();
90 a.reference = sub::TOP_OF_SCREEN;
93 b.reference = sub::TOP_OF_SCREEN;