1
+ /* *
2
+ *
3
+ */
4
+
5
+ #define BOOST_TEST_DYN_LINK
6
+ #include " ../helper.hpp"
7
+ #include < boost/test/unit_test.hpp>
8
+
9
+ BOOST_AUTO_TEST_SUITE ( variable_types )
10
+
11
+
12
+ BOOST_AUTO_TEST_SUITE( integers_are_standard )
13
+
14
+ BOOST_AUTO_TEST_CASE( simple_integer_numbers )
15
+ {
16
+ int an_integer = 42 ;
17
+ // You should replace 'FILL_THE_NUMBER_IN' with the propper value to satisfy the equation
18
+ BOOST_CHECK_MESSAGE ( an_integer == FILL_THE_NUMBER_IN, " This equality should be satisfied." );
19
+ }
20
+
21
+ BOOST_AUTO_TEST_CASE ( integers_have_a_size )
22
+ {
23
+ int an_integer = 1 ;
24
+ BOOST_CHECK_MESSAGE ( sizeof ( int ) == FILL_THE_NUMBER_IN, " How big is an integer?" );
25
+ BOOST_CHECK_MESSAGE ( sizeof ( an_integer ) == FILL_THE_NUMBER_IN, " How big is an_integer?" );
26
+ }
27
+
28
+ BOOST_AUTO_TEST_CASE ( integers_can_be_negative )
29
+ {
30
+ int an_integer = 42 ;
31
+ int another_integer = -42 ;
32
+ BOOST_CHECK_MESSAGE ( an_integer < another_integer, " Which is bigger?" );
33
+ }
34
+
35
+ BOOST_AUTO_TEST_SUITE_END () // End of integers_are_standard
36
+
37
+
38
+ BOOST_AUTO_TEST_SUITE( floating_points )
39
+
40
+ BOOST_AUTO_TEST_CASE( simple_floats )
41
+ {
42
+ float a_float = 4.2 ;
43
+ BOOST_CHECK_MESSAGE ( a_float == FILL_THE_NUMBER_IN, " This equality should be satisfied." );
44
+ }
45
+
46
+ BOOST_AUTO_TEST_CASE ( floats_have_a_size )
47
+ {
48
+ int a_float = 4.2 ;
49
+ BOOST_CHECK_MESSAGE ( sizeof ( float ) == FILL_THE_NUMBER_IN, " How big is a float?" );
50
+ BOOST_CHECK_MESSAGE ( sizeof ( a_float ) == FILL_THE_NUMBER_IN, " How big is a_float?" );
51
+ }
52
+
53
+ BOOST_AUTO_TEST_SUITE_END () // End of floating_points
54
+
55
+
56
+ BOOST_AUTO_TEST_SUITE( bigger_numbers )
57
+
58
+ BOOST_AUTO_TEST_CASE( going_double_precision ) {
59
+
60
+ }
61
+
62
+ BOOST_AUTO_TEST_CASE ( doubles_have_a_size )
63
+ {
64
+ int a_double = 4.2 ;
65
+ BOOST_CHECK_MESSAGE ( sizeof ( double ) == FILL_THE_NUMBER_IN, " How big is a double?" );
66
+ BOOST_CHECK_MESSAGE ( sizeof ( a_double ) == FILL_THE_NUMBER_IN, " How big is a_double?" );
67
+ }
68
+
69
+ BOOST_AUTO_TEST_SUITE_END () // End of bigger_numbers
70
+
71
+
72
+ BOOST_AUTO_TEST_SUITE( going_even_bigger )
73
+
74
+ BOOST_AUTO_TEST_CASE( size_of_biggest_number )
75
+ {
76
+ BOOST_TEST_MESSAGE (" The size of long doubles vary from system to system." );
77
+ long double a_long_double = 4.2 ;
78
+ BOOST_CHECK_MESSAGE ( sizeof ( long double ) == FILL_THE_NUMBER_IN, " How big is a long double on your machine?" );
79
+ BOOST_CHECK_MESSAGE ( sizeof ( a_long_double ) == FILL_THE_NUMBER_IN, " How big is a_long_double?" );
80
+ }
81
+
82
+ BOOST_AUTO_TEST_SUITE_END () // End of going_even_bigger
83
+
84
+
85
+ BOOST_AUTO_TEST_SUITE_END() // End of variable_types
86
+
87
+ // EOF
0 commit comments