Mir

Merge lp:~albaguirre/mir/allow-null-cmd-line into lp:mir

Proposed by Alberto Aguirre
Status: Rejected
Rejected by: Alberto Aguirre
Proposed branch: lp:~albaguirre/mir/allow-null-cmd-line
Merge into: lp:mir
Diff against target: 37 lines (+15/-1)
2 files modified
src/platform/options/default_configuration.cpp (+3/-1)
tests/acceptance-tests/server_configuration_options.cpp (+12/-0)
To merge this branch: bzr merge lp:~albaguirre/mir/allow-null-cmd-line
Reviewer Review Type Date Requested Status
Alan Griffiths Disapprove
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+266512@code.launchpad.net

Commit message

Allow empty cmd line in mir::options::DefaultConfiguration

Description of the change

Allow empty cmd line in mir::options::DefaultConfiguration

Qtmir's test suite allocates a DefaultConfiguration object with an empty command line.

This change comes from mir 0.14

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> This change was already rejected recently...
> https://code.launchpad.net/~andreas-pokorny/mir/fix-null-cmdline-
> crash/+merge/265936

review: Disapprove
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Ah missed that this was rejected already.

Thanks Andreas.

Unmerged revisions

2799. By Andreas Pokorny

Allow empty cmd line in mir::options::DefaultConfiguration

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platform/options/default_configuration.cpp'
2--- src/platform/options/default_configuration.cpp 2015-07-23 02:39:20 +0000
3+++ src/platform/options/default_configuration.cpp 2015-07-31 03:42:35 +0000
4@@ -131,7 +131,9 @@
5 argv(argv),
6 unparsed_arguments_handler{handler},
7 program_options(std::make_shared<boost::program_options::options_description>(
8- description_text(argv[0], config_file)))
9+ description_text(
10+ (argc && argv)?argv[0]:"mir-server",
11+ config_file)))
12 {
13 using namespace options;
14 namespace po = boost::program_options;
15
16=== modified file 'tests/acceptance-tests/server_configuration_options.cpp'
17--- tests/acceptance-tests/server_configuration_options.cpp 2014-11-06 13:26:52 +0000
18+++ tests/acceptance-tests/server_configuration_options.cpp 2015-07-31 03:42:35 +0000
19@@ -123,6 +123,18 @@
20 server.apply_settings();
21 }
22
23+TEST_F(ServerConfigurationOptions, empty_command_line_is_allowed)
24+{
25+ int const argc{0};
26+ char const** argv{nullptr};
27+
28+ server.set_command_line(argc, argv);
29+
30+ EXPECT_CALL(*this, command_line_handler(_)).Times(0);
31+
32+ server.apply_settings();
33+}
34+
35 TEST_F(ServerConfigurationOptions, are_read_from_xdg_config_home)
36 {
37 create_config_file_in(fake_xdg_config_home);

Subscribers

People subscribed via source and target branches