Don’t assume first CL arg (exe name) is present

Fixes #729
This commit is contained in:
Phil Nash
2017-03-13 11:00:58 +00:00
parent db9866677e
commit 38b05f1400
6 changed files with 66 additions and 7 deletions

View File

@@ -5871,6 +5871,23 @@ MessageTests.cpp:<line number>:
warning:
toString(p): 0x<hex digits>
-------------------------------------------------------------------------------
Process can be configured on command line
empty args don't cause a crash
-------------------------------------------------------------------------------
TestMain.cpp:<line number>
...............................................................................
TestMain.cpp:<line number>:
PASSED:
CHECK_NOTHROW( parser.parseInto( std::vector<std::string>(), config ) )
TestMain.cpp:<line number>:
PASSED:
CHECK( config.processName == "" )
with expansion:
"" == ""
-------------------------------------------------------------------------------
Process can be configured on command line
default - no arguments
@@ -5882,6 +5899,12 @@ TestMain.cpp:<line number>:
PASSED:
CHECK_NOTHROW( parseIntoConfig( argv, config ) )
TestMain.cpp:<line number>:
PASSED:
CHECK( config.processName == "test" )
with expansion:
"test" == "test"
TestMain.cpp:<line number>:
PASSED:
CHECK( config.shouldDebugBreak == false )
@@ -9382,5 +9405,5 @@ PASSED:
===============================================================================
test cases: 166 | 118 passed | 45 failed | 3 failed as expected
assertions: 960 | 852 passed | 89 failed | 19 failed as expected
assertions: 963 | 855 passed | 89 failed | 19 failed as expected