Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[url_launcher] Fix minor memory leak in Linux url-launcher tests #4648

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/url_launcher/url_launcher_linux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

* Updates code for new analysis options.
* Fix minor memory leak in Linux url_launcher tests.

## 2.0.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TEST(UrlLauncherPlugin, CanLaunchSuccess) {
g_autoptr(FlValue) args = fl_value_new_map();
fl_value_set_string_take(args, "url",
fl_value_new_string("https://flutter.dev"));
FlMethodResponse* response = can_launch(nullptr, args);
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
ASSERT_NE(response, nullptr);
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
g_autoptr(FlValue) expected = fl_value_new_bool(true);
Expand All @@ -30,7 +30,7 @@ TEST(UrlLauncherPlugin, CanLaunchSuccess) {
TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) {
g_autoptr(FlValue) args = fl_value_new_map();
fl_value_set_string_take(args, "url", fl_value_new_string("madeup:scheme"));
FlMethodResponse* response = can_launch(nullptr, args);
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
ASSERT_NE(response, nullptr);
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
g_autoptr(FlValue) expected = fl_value_new_bool(false);
Expand All @@ -44,7 +44,7 @@ TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) {
TEST(UrlLauncherPlugin, CanLaunchFailureInvalidUrl) {
g_autoptr(FlValue) args = fl_value_new_map();
fl_value_set_string_take(args, "url", fl_value_new_string(""));
FlMethodResponse* response = can_launch(nullptr, args);
g_autoptr(FlMethodResponse) response = can_launch(nullptr, args);
ASSERT_NE(response, nullptr);
ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response));
g_autoptr(FlValue) expected = fl_value_new_bool(false);
Expand Down