• Home
  • Raw
  • Download

Lines Matching refs:actual

44 #define EXPECT_JSON_EQ(expected, actual) \  argument
45 EXPECT_PRED2(IsEqualValue, *ParseValue(expected), actual)
50 int actual; in TEST() local
51 EXPECT_TRUE(FromValue(*ParseValue("123"), &actual)); in TEST()
52 EXPECT_EQ(123, actual); in TEST()
54 EXPECT_TRUE(FromValue(*ParseValue("-123"), &actual)); in TEST()
55 EXPECT_EQ(-123, actual); in TEST()
57 EXPECT_FALSE(FromValue(*ParseValue("true"), &actual)); in TEST()
61 bool actual; in TEST() local
62 EXPECT_TRUE(FromValue(*ParseValue("false"), &actual)); in TEST()
63 EXPECT_FALSE(actual); in TEST()
65 EXPECT_TRUE(FromValue(*ParseValue("true"), &actual)); in TEST()
66 EXPECT_TRUE(actual); in TEST()
68 EXPECT_FALSE(FromValue(*ParseValue("0"), &actual)); in TEST()
69 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual)); in TEST()
73 double actual; in TEST() local
74 EXPECT_TRUE(FromValue(*ParseValue("12.5"), &actual)); in TEST()
75 EXPECT_DOUBLE_EQ(12.5, actual); in TEST()
77 EXPECT_TRUE(FromValue(*ParseValue("-0.1"), &actual)); in TEST()
78 EXPECT_DOUBLE_EQ(-0.1, actual); in TEST()
80 EXPECT_TRUE(FromValue(*ParseValue("17"), &actual)); in TEST()
81 EXPECT_DOUBLE_EQ(17.0, actual); in TEST()
83 EXPECT_FALSE(FromValue(*ParseValue("'1.0'"), &actual)); in TEST()
87 std::string actual; in TEST() local
88 EXPECT_TRUE(FromValue(*ParseValue("'foo'"), &actual)); in TEST()
89 EXPECT_EQ("foo", actual); in TEST()
91 EXPECT_TRUE(FromValue(*ParseValue("'bar'"), &actual)); in TEST()
92 EXPECT_EQ("bar", actual); in TEST()
94 EXPECT_TRUE(FromValue(*ParseValue("''"), &actual)); in TEST()
95 EXPECT_TRUE(actual.empty()); in TEST()
97 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual)); in TEST()
127 std::vector<int> actual; in TEST() local
128 EXPECT_TRUE(FromValue(*ParseValue("[1, 2, 3, 4]"), &actual)); in TEST()
129 EXPECT_EQ((std::vector<int>{1, 2, 3, 4}), actual); in TEST()
131 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
132 EXPECT_TRUE(actual.empty()); in TEST()
134 EXPECT_FALSE(FromValue(*ParseValue("[1, 2, 3, '4']"), &actual)); in TEST()
138 std::vector<bool> actual; in TEST() local
139 EXPECT_TRUE(FromValue(*ParseValue("[true, true, false]"), &actual)); in TEST()
140 EXPECT_EQ((std::vector<bool>{true, true, false}), actual); in TEST()
142 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
143 EXPECT_TRUE(actual.empty()); in TEST()
145 EXPECT_FALSE(FromValue(*ParseValue("[true, 0]"), &actual)); in TEST()
149 std::vector<double> actual; in TEST() local
150 EXPECT_TRUE(FromValue(*ParseValue("[1, 2.0, 6.5, -11.2]"), &actual)); in TEST()
151 EXPECT_EQ((std::vector<double>{1.0, 2.0, 6.5, -11.2}), actual); in TEST()
153 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
154 EXPECT_TRUE(actual.empty()); in TEST()
156 EXPECT_FALSE(FromValue(*ParseValue("['s']"), &actual)); in TEST()
160 std::vector<std::string> actual; in TEST() local
161 EXPECT_TRUE(FromValue(*ParseValue("['', 'foo', 'bar']"), &actual)); in TEST()
162 EXPECT_EQ((std::vector<std::string>{"", "foo", "bar"}), actual); in TEST()
164 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
165 EXPECT_TRUE(actual.empty()); in TEST()
167 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual)); in TEST()
171 std::vector<std::vector<int>> actual; in TEST() local
172 EXPECT_TRUE(FromValue(*ParseValue("[[1,2], [], [3]]"), &actual)); in TEST()
173 EXPECT_EQ((std::vector<std::vector<int>>{{1,2}, {}, {3}}), actual); in TEST()
175 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
176 EXPECT_TRUE(actual.empty()); in TEST()
178 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual)); in TEST()
182 std::map<std::string, int> actual; in TEST() local
183 EXPECT_TRUE(FromValue(*ParseValue("{'foo':1, 'bar':2, 'baz':3}"), &actual)); in TEST()
185 actual); in TEST()
187 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual)); in TEST()
188 EXPECT_TRUE(actual.empty()); in TEST()
190 EXPECT_FALSE(FromValue(*ParseValue("{'foo':1, 'bar':'2'}"), &actual)); in TEST()
194 std::map<std::string, std::vector<int>> actual; in TEST() local
195 EXPECT_TRUE(FromValue(*ParseValue("{'foo':[1,2], 'bar':[]}"), &actual)); in TEST()
198 EXPECT_EQ(expected, actual); in TEST()
200 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual)); in TEST()
201 EXPECT_TRUE(actual.empty()); in TEST()
203 EXPECT_FALSE(FromValue(*ParseValue("{'foo':[1], 'bar':[2,'3']}"), &actual)); in TEST()
207 std::vector<std::map<std::string, int>> actual; in TEST() local
208 EXPECT_TRUE(FromValue(*ParseValue("[{'foo':1,'bar':2},{'baz':3}]"), &actual)); in TEST()
211 EXPECT_EQ(expected, actual); in TEST()
213 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
214 EXPECT_TRUE(actual.empty()); in TEST()
216 EXPECT_FALSE(FromValue(*ParseValue("[{'foo':1}, 'bar']"), &actual)); in TEST()
220 std::vector<std::unique_ptr<base::ListValue>> actual; in TEST() local
221 EXPECT_TRUE(FromValue(*ParseValue("[['foo',1],['bar',2],[true]]"), &actual)); in TEST()
222 ASSERT_EQ(3, actual.size()); in TEST()
223 EXPECT_JSON_EQ("['foo', 1]", *actual[0]); in TEST()
224 EXPECT_JSON_EQ("['bar', 2]", *actual[1]); in TEST()
225 EXPECT_JSON_EQ("[true]", *actual[2]); in TEST()
229 std::vector<std::unique_ptr<base::DictionaryValue>> actual; in TEST() local
230 EXPECT_TRUE(FromValue(*ParseValue("[{'foo': 1}, {'bar': 2}]"), &actual)); in TEST()
231 ASSERT_EQ(2, actual.size()); in TEST()
232 EXPECT_JSON_EQ("{'foo': 1}", *actual[0]); in TEST()
233 EXPECT_JSON_EQ("{'bar': 2}", *actual[1]); in TEST()