Merge lp:~andreas-pokorny/qtmir/devel-mir-next-avoid-empty-cmdline-params into lp:qtmir/devel-mir-next

Proposed by Andreas Pokorny
Status: Merged
Approved by: Alberto Aguirre
Approved revision: 290
Merged at revision: 289
Proposed branch: lp:~andreas-pokorny/qtmir/devel-mir-next-avoid-empty-cmdline-params
Merge into: lp:qtmir/devel-mir-next
Diff against target: 18 lines (+4/-1)
1 file modified
tests/modules/common/qtmir_test.h (+4/-1)
To merge this branch: bzr merge lp:~andreas-pokorny/qtmir/devel-mir-next-avoid-empty-cmdline-params
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+266234@code.launchpad.net

Commit message

tests: pass an aribtrary application name to MirServer

Preparation for 0.15.

Description of the change

Since 0.14 mir evaluates the application name by accessing args[0]. To unblock the release 0.14 accepted invalid command line arguments. This is not the case on lp:mir or the upcoming 0.15 release.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Well, this likely works but argv is /supposed/ to be NULL terminated. Something like:

namespace { char const* const argv[] = { "qtmir-test", nullptr }; }

Revision history for this message
Gerry Boland (gerboland) wrote :

Why does mir care about the application name?

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Why does mir care about the application name?

It is used in generating the description text for the command line options. The code (src/platform/options/default_configuration.cpp) allows argv to be a single element "null terminated list" - so this would be fine:

namespace { char const* argv[] = { nullptr }; }
...
+ : MirServer(0, &args)

review: Needs Fixing
289. By Andreas Pokorny

make it null terminated

290. By Andreas Pokorny

remove the dummy application name

Revision history for this message
Alan Griffiths (alan-griffiths) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/modules/common/qtmir_test.h'
2--- tests/modules/common/qtmir_test.h 2015-03-24 23:38:33 +0000
3+++ tests/modules/common/qtmir_test.h 2015-07-31 08:37:21 +0000
4@@ -64,11 +64,14 @@
5 {std::make_shared<StubPromptSessionManager>()};
6 };
7
8+
9+namespace { char const* argv[] = { nullptr }; }
10+
11 class FakeMirServer: private TestMirServerInit, public MirServer
12 {
13 public:
14 FakeMirServer()
15- : MirServer(0, nullptr)
16+ : MirServer(0, argv)
17 {
18 }
19

Subscribers

People subscribed via source and target branches