56{
57 bool orangeValue;
58 REQUIRE(
settings.Write(
"orange",
true));
59 REQUIRE(
settings.Read(
"orange", &orangeValue));
60 REQUIRE(orangeValue == true);
61
62 int appleValue;
64 REQUIRE(
settings.Read(
"apple", &appleValue));
65 REQUIRE(appleValue == 3);
66
67 long long plumValue;
68 REQUIRE(
settings.Write(
"plum", std::numeric_limits<long long>::max()));
69 REQUIRE(
settings.Read(
"plum", &plumValue));
70 REQUIRE(plumValue == std::numeric_limits<long long>::max());
71
72 double pearValue;
73 REQUIRE(
settings.Write(
"pear", std::numeric_limits<double>::epsilon()));
74 REQUIRE(
settings.Read(
"pear", &pearValue));
75 REQUIRE(std::abs(pearValue - std::numeric_limits<double>::epsilon()) <= 0.001);
76
77 wxString pineappleValue;
78 REQUIRE(
settings.Write(
"pineapple",
"Lorem Ipsum"));
79 REQUIRE(
settings.Read(
"pineapple", &pineappleValue));
80 REQUIRE(pineappleValue == "Lorem Ipsum");
81
84 REQUIRE(
settings.Read(
"mango", &mangoValue));
85 REQUIRE(mangoValue.value == 1431655765);
86
87 REQUIRE(
settings.Read(
"orange", &orangeValue,
false));
88 REQUIRE(orangeValue == true);
89 REQUIRE(
settings.Read(
"apple", &appleValue, 1000));
90 REQUIRE(appleValue == 3);
91 REQUIRE(
settings.Read(
"plum", &plumValue, 2000LL));
92 REQUIRE(plumValue == std::numeric_limits<long long>::max());
93 REQUIRE(
settings.Read(
"pear", &pearValue, 3000.0));
94 REQUIRE(std::abs(pearValue - std::numeric_limits<double>::epsilon()) <= 0.001);
95 REQUIRE(
settings.Read(
"pineapple", &pineappleValue, { }));
96 REQUIRE(pineappleValue == "Lorem Ipsum");
97
98 bool orange1;
99 REQUIRE(!
settings.Read(
"orange1", &orange1, orangeValue));
100 REQUIRE(orange1 == orangeValue);
101 int apple1;
102 REQUIRE(!
settings.Read(
"apple1", &apple1, appleValue));
103 REQUIRE(apple1 == appleValue);
104 long long plum1;
105 REQUIRE(!
settings.Read(
"plum1", &plum1, plumValue));
106 REQUIRE(plum1 == plumValue);
107 double pear1;
108 REQUIRE(!
settings.Read(
"pear1", &pear1, pearValue));
109 REQUIRE(std::abs(pearValue - pear1) <= 0.001);
110 wxString pineapple1;
111 REQUIRE(!
settings.Read(
"pineapple1", &pineapple1, pineappleValue));
112 REQUIRE(pineapple1 == pineappleValue);
114 REQUIRE(!
settings.Read(
"mango1", &mango1, mangoValue));
115 REQUIRE(mango1 == mangoValue);
116
117 REQUIRE(
settings.Read(
"pineapple") == pineappleValue);
118 REQUIRE(
settings.Read(
"pineapp").IsEmpty());
119 REQUIRE(
settings.Read(
"pineapp",
"not found") ==
"not found");
120 REQUIRE(
settings.Read(
"pineapp", L
"not found") == L
"not found");
121
122 REQUIRE(
settings.Read(
"orange",
false) == orangeValue);
123 REQUIRE(
settings.Read(
"apple", 0) == appleValue);
124 REQUIRE(
settings.Read(
"plum", 0LL) == plumValue);
125 REQUIRE(
settings.Read(
"pear", 0.0) == pearValue);
127
128 REQUIRE(
settings.Write(
"moon",
"full"));
129 REQUIRE(
settings.Read(
"moon") ==
"full");
130
131 REQUIRE(
settings.Write(
"star", L
"yellow"));
132 REQUIRE(
settings.Read(
"star") == L
"yellow");
133}