7 use fruit,
only : assert_equals, assert_true, assert_false
31 type(map_type) :: options_database
32 class(*),
pointer :: raw_data
38 raw_data=>c_get(options_database,
"test1")
39 call assert_true(
conv_to_logical(raw_data, .false.),
"Logical no value is true")
40 raw_data=>c_get(options_database,
"test2")
41 call assert_false(
conv_to_logical(raw_data, .false.),
"Logical false values")
42 raw_data=>c_get(options_database,
"test3")
43 call assert_true(
conv_to_logical(raw_data, .false.),
"Logical true values")
48 type(map_type) :: options_database
49 class(*),
pointer :: raw_data
56 raw_data=>c_get(options_database,
"test1")
57 call assert_equals(9542,
conv_to_integer(raw_data, .false.),
"Simple integer value added")
58 raw_data=>c_get(options_database,
"test2")
59 call assert_equals(-1234,
conv_to_integer(raw_data, .false.),
"Negative integer value added")
60 raw_data=>c_get(options_database,
"test3")
61 call assert_equals(82,
conv_to_integer(raw_data, .false.),
"Positive integer value added")
62 raw_data=>c_get(options_database,
"test4")
63 call assert_equals(0,
conv_to_integer(raw_data, .false.),
"Zero integer value added")
69 type(map_type) :: options_database
70 class(*),
pointer :: raw_data
77 raw_data=>c_get(options_database,
"test1")
78 call assert_equals(9542.342,
conv_to_real(raw_data, .false.),
"Simple float value added")
79 raw_data=>c_get(options_database,
"test2")
80 call assert_equals(-1.33e9,
conv_to_real(raw_data, .false.),
"Negative with exponent value added")
81 raw_data=>c_get(options_database,
"test3")
82 call assert_equals(987.232e-6,
conv_to_real(raw_data, .false.), &
83 "Positive with negative exponent value added")
84 raw_data=>c_get(options_database,
"test4")
85 call assert_equals(-98.72,
conv_to_real(raw_data, .false.),
"Negative float value added")
91 type(map_type) :: options_database
92 class(*),
pointer :: raw_data
97 raw_data=>c_get(options_database,
"test1")
98 call assert_equals(
"abc",
conv_to_string(raw_data, .false., 44),
"Simple string")
99 raw_data=>c_get(options_database,
"test2")
100 call assert_equals(
"HeLlO",
conv_to_string(raw_data, .false., 44),
"Case sensitive string")
106 use fruit,
only : init_fruit, run_test_case, fruit_summary