| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM w/ AI comments that I've confirmed.
ASSERT_EQ(options.is_initial_heartbeat, is_initial_heartbeat);`is_initial_heartbeat` is the actual value passed into the lambda, and `options.is_initial_heartbeat` is the configured expected value. This was already `(actual, expected)`, so flipping it here accidentally made it `(expected, actual)`!
EXPECT_EQ(GVariantRef<"v">::From(gvariant::Boxed(value)),Missed one! `GVariantRef<"v">::From(gvariant::Boxed(value))` is the expected value. (Also check line 245 below).
GVariantParse<"ms">("just 'apple'").Into<std::optional<std::string>>());Missed one! `std::optional(std::string("apple"))` is the expected value, and `GVariantParse...` is the actual. There are actually several missed flips throughout this file.
EXPECT_EQ(MakeResolution(100, 100),Missed one! `MakeResolution(100, 100)` is the expected value here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
ASSERT_EQ(options.is_initial_heartbeat, is_initial_heartbeat);`is_initial_heartbeat` is the actual value passed into the lambda, and `options.is_initial_heartbeat` is the configured expected value. This was already `(actual, expected)`, so flipping it here accidentally made it `(expected, actual)`!
Ah you're right, this is a tricky one. I need to flip line 80 as well then.
EXPECT_EQ(GVariantRef<"v">::From(gvariant::Boxed(value)),Missed one! `GVariantRef<"v">::From(gvariant::Boxed(value))` is the expected value. (Also check line 245 below).
Oh interesting, thanks!
GVariantParse<"ms">("just 'apple'").Into<std::optional<std::string>>());Missed one! `std::optional(std::string("apple"))` is the expected value, and `GVariantParse...` is the actual. There are actually several missed flips throughout this file.
Done!
Missed one! `MakeResolution(100, 100)` is the expected value here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: remoting/host/linux/gvariant_ref_unittest.cc
Insertions: 36, Deletions: 35.
@@ -144,11 +144,10 @@
base::ok(GVariantParse<"mn">("just 539")));
EXPECT_EQ(
- std::optional(std::string("apple")),
- GVariantParse<"ms">("just 'apple'").Into<std::optional<std::string>>());
- EXPECT_EQ(
- std::optional<std::uint32_t>(),
- GVariantParse<"mu">("nothing").Into<std::optional<std::uint32_t>>());
+ GVariantParse<"ms">("just 'apple'").Into<std::optional<std::string>>(),
+ std::optional(std::string("apple")));
+ EXPECT_EQ(GVariantParse<"mu">("nothing").Into<std::optional<std::uint32_t>>(),
+ std::optional<std::uint32_t>());
EXPECT_EQ((GVariantParse<"ms", "*">("just 'peach'")
.TryInto<std::optional<std::string>>()),
base::ok(std::optional(std::string("peach"))));
@@ -183,9 +182,9 @@
EXPECT_EQ((GVariantParse<"ad", "*">("[]").TryInto<std::vector<double>>()),
base::ok(std::vector<double>()));
EXPECT_EQ(
- (std::vector<std::string>{"cabbage", "broccoli", "kale", "cauliflower"}),
GVariantParse<"as">("['cabbage', 'broccoli', 'kale', 'cauliflower']")
- .Into<std::vector<std::string>>());
+ .Into<std::vector<std::string>>(),
+ (std::vector<std::string>{"cabbage", "broccoli", "kale", "cauliflower"}));
EXPECT_FALSE((GVariantParse<"i", "*">("7")
.TryInto<std::vector<std::int32_t>>()
@@ -218,10 +217,10 @@
EXPECT_EQ((GVariantParse<"a{by}", "*">("{}")
.TryInto<std::map<bool, std::uint8_t>>()),
base::ok(std::map<bool, std::uint8_t>()));
- EXPECT_EQ(
- (std::map<std::int32_t, double>{{1, 1}, {2, 0.5}, {4, 0.25}, {8, 0.125}}),
- (GVariantParse<"a{id}">("{1: 1, 2: 0.5, 4: 0.25, 8: 0.125}")
- .Into<std::map<int32_t, double>>()));
+ EXPECT_EQ((GVariantParse<"a{id}">("{1: 1, 2: 0.5, 4: 0.25, 8: 0.125}")
+ .Into<std::map<int32_t, double>>()),
+ (std::map<std::int32_t, double>{
+ {1, 1}, {2, 0.5}, {4, 0.25}, {8, 0.125}}));
EXPECT_FALSE((GVariantParse<"i", "*">("-3")
.TryInto<std::map<std::uint32_t, std::uint8_t>>()
@@ -254,9 +253,9 @@
EXPECT_EQ((GVariantParse<"{by}", "*">("{true, 9}")
.TryInto<std::pair<bool, std::uint8_t>>()),
base::ok(std::pair<bool, std::uint8_t>(true, 9)));
- EXPECT_EQ((std::pair<double, std::string>(6.5, "poof")),
- (GVariantParse<"{ds}">("{6.5, 'poof'}")
- .Into<std::pair<double, std::string>>()));
+ EXPECT_EQ((GVariantParse<"{ds}">("{6.5, 'poof'}")
+ .Into<std::pair<double, std::string>>()),
+ (std::pair<double, std::string>(6.5, "poof")));
EXPECT_FALSE((GVariantParse<"{uu}", "*">("{5, 7}")
.TryInto<std::pair<std::uint32_t, std::uint8_t>>()
@@ -282,10 +281,10 @@
EXPECT_EQ((GVariantParse<"()", "*">("()").TryInto<std::tuple<>>()),
base::ok(std::tuple()));
- EXPECT_EQ(
- std::tuple(std::string("fancy"), false, double{-6.75}, std::int64_t{512}),
- (GVariantParse<"(sbdx)">("('fancy', false, -6.75, 512)")
- .Into<std::tuple<std::string, bool, double, std::int64_t>>()));
+ EXPECT_EQ((GVariantParse<"(sbdx)">("('fancy', false, -6.75, 512)")
+ .Into<std::tuple<std::string, bool, double, std::int64_t>>()),
+ std::tuple(std::string("fancy"), false, double{-6.75},
+ std::int64_t{512}));
EXPECT_FALSE((GVariantParse<"i", "*">("4")
.TryInto<std::tuple<std::int32_t>>()
@@ -332,19 +331,21 @@
EXPECT_EQ(GVariantParse<"ms">("just 'delicata squash'"),
GVariantFrom(Mixed(std::in_place_index<2>, "delicata squash")));
- EXPECT_EQ(Strings(std::in_place_index<1>, "eggplant"),
- GVariantParse<"s">("'eggplant'").Into<Strings>());
+ EXPECT_EQ(GVariantParse<"s">("'eggplant'").Into<Strings>(),
+ Strings(std::in_place_index<1>, "eggplant"));
- EXPECT_EQ(BasicArrays(std::in_place_index<2>, std::vector{true, false, true}),
- GVariantParse<"ab">("[true, false, true]").Into<BasicArrays>());
+ EXPECT_EQ(
+ GVariantParse<"ab">("[true, false, true]").Into<BasicArrays>(),
+ BasicArrays(std::in_place_index<2>, std::vector{true, false, true}));
EXPECT_EQ((GVariantParse<"y", "*">("12").TryInto<Mixed>()),
base::ok(Mixed(std::in_place_index<0>, 12)));
- EXPECT_EQ(Mixed(std::in_place_index<1>, 9.75),
- GVariantParse<"d">("9.75").Into<GVariantRef<"?">>().Into<Mixed>());
+ EXPECT_EQ(GVariantParse<"d">("9.75").Into<GVariantRef<"?">>().Into<Mixed>(),
+ Mixed(std::in_place_index<1>, 9.75));
EXPECT_EQ(
- Mixed(std::in_place_index<3>, GVariantRef<"?">::From(std::int32_t{93})),
- GVariantParse<"i">("93").Into<Mixed>());
+
+ GVariantParse<"i">("93").Into<Mixed>(),
+ Mixed(std::in_place_index<3>, GVariantRef<"?">::From(std::int32_t{93})));
// Doesn't match type string.
EXPECT_FALSE((GVariantParse<"i", "*">("16").TryInto<Strings>().has_value()));
@@ -418,11 +419,11 @@
EXPECT_EQ(GVariantParse<"v">("<['chirp', 'whistle']>"),
GVariantFrom(BoxedRef(value)));
- EXPECT_EQ((Boxed<std::variant<std::uint16_t, std::string>>{"boop"}),
- (GVariantParse<"v">("<'boop'>")
- .TryInto<Boxed<std::variant<std::uint16_t, std::string>>>()));
- EXPECT_EQ(Boxed{GVariantFrom(std::int64_t{-204})},
- GVariantParse<"v">("<int64 -204>").Into<Boxed<GVariantRef<>>>());
+ EXPECT_EQ((GVariantParse<"v">("<'boop'>")
+ .TryInto<Boxed<std::variant<std::uint16_t, std::string>>>()),
+ (Boxed<std::variant<std::uint16_t, std::string>>{"boop"}));
+ EXPECT_EQ(GVariantParse<"v">("<int64 -204>").Into<Boxed<GVariantRef<>>>(),
+ Boxed{GVariantFrom(std::int64_t{-204})});
EXPECT_FALSE((GVariantParse<"i", "*">("-27")
.TryInto<Boxed<std::int32_t>>()
@@ -486,8 +487,8 @@
EXPECT_EQ(GVariantParse<"o">("'/valid/path'"),
GVariantFrom(ObjectPathCStr(path.value())));
- EXPECT_EQ(path.value(),
- GVariantParse<"o">("'/valid/path'").Into<ObjectPath>());
+ EXPECT_EQ(GVariantParse<"o">("'/valid/path'").Into<ObjectPath>(),
+ path.value());
EXPECT_EQ(GVariantParse<"o">("'/path/constant'"),
GVariantFrom(ObjectPathCStr("/path/constant")));
@@ -507,8 +508,8 @@
EXPECT_EQ(GVariantParse<"g">("'goodsig'"),
GVariantFrom(TypeSignatureCStr(signature.value())));
- EXPECT_EQ(signature.value(),
- GVariantParse<"g">("'goodsig'").Into<TypeSignature>());
+ EXPECT_EQ(GVariantParse<"g">("'goodsig'").Into<TypeSignature>(),
+ signature.value());
EXPECT_EQ(GVariantParse<"g">("'gonstsig'"),
GVariantFrom(TypeSignatureCStr("gonstsig")));
```
```
The name of the file: remoting/host/linux/gdbus_connection_ref_unittest.cc
Insertions: 4, Deletions: 4.
@@ -133,8 +133,8 @@
auto [interface_name, changed_properties, invalidated_properties] =
change_signal.Take();
EXPECT_EQ(interface_name.string_view(), test_interface::Name::kInterfaceName);
- EXPECT_EQ(GVariantRef<"v">::From(gvariant::Boxed(value)),
- changed_properties.LookUp(test_interface::Name::kPropertyName));
+ EXPECT_EQ(changed_properties.LookUp(test_interface::Name::kPropertyName),
+ GVariantRef<"v">::From(gvariant::Boxed(value)));
}
TEST_F(GDBusConnectionRefTest, SignalSubscribe) {
@@ -242,8 +242,8 @@
GVariantRef<org_freedesktop_DBus_Properties::PropertiesChanged::kType>::
TryFrom(arguments);
ASSERT_TRUE(typed_args.has_value());
- EXPECT_EQ(GVariantRef<"v">::From(gvariant::Boxed(prop_value)),
- typed_args->get<1>().LookUp(test_interface::Name::kPropertyName));
+ EXPECT_EQ(typed_args->get<1>().LookUp(test_interface::Name::kPropertyName),
+ GVariantRef<"v">::From(gvariant::Boxed(prop_value)));
}
}
```
```
The name of the file: remoting/host/heartbeat_sender_unittest.cc
Insertions: 2, Deletions: 2.
@@ -73,11 +73,11 @@
return [=](bool is_initial_heartbeat, std::optional<std::string> signaling_id,
std::optional<std::string> offline_reason,
HeartbeatServiceClient::HeartbeatResponseCallback callback) {
- ASSERT_EQ(options.is_initial_heartbeat, is_initial_heartbeat);
+ ASSERT_EQ(is_initial_heartbeat, options.is_initial_heartbeat);
if (options.host_offline_reason.empty()) {
ASSERT_FALSE(offline_reason);
} else {
- ASSERT_EQ(options.host_offline_reason, *offline_reason);
+ ASSERT_EQ(*offline_reason, options.host_offline_reason);
}
base::TimeDelta wait_interval = base::Seconds(kGoodIntervalSeconds);
```
```
The name of the file: remoting/host/resizing_host_observer_unittest.cc
Insertions: 2, Deletions: 2.
@@ -355,8 +355,8 @@
EXPECT_EQ(GetBestResolution(MakeResolution(200, 200)),
MakeResolution(100, 100));
clock_.Advance(base::Milliseconds(99));
- EXPECT_EQ(MakeResolution(100, 100),
- GetBestResolution(MakeResolution(300, 300)));
+ EXPECT_EQ(GetBestResolution(MakeResolution(300, 300)),
+ MakeResolution(100, 100));
clock_.Advance(base::Milliseconds(1));
// Due to the kMinimumResizeIntervalMs constant in resizing_host_observer.cc,
```
[remoting]: Fix Yoda-style asserts in host tests
This CL flips the arguments of EXPECT_EQ/ASSERT_EQ in
remoting/host/*test.cc from (expected, actual) to the more natural
(actual, expected) format.
Also fixed a few minor issues I found along the way.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |