[DOCS-8959] mongo/util/options_parser/options_parser_test fails Created: 28/Sep/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-20754 mongo/util/options_parser/options_par... Closed
Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

I was trying to build MongoDB with boost 1.59 and optons_parser_test was failing.

2015-09-18T10:41:18.279+0000 I -        **************************************************
2015-09-18T10:41:18.279+0000 I -        ChainingInterface              | tests:   18 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        ConfigFromFilesystem           | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.169
2015-09-18T10:41:18.279+0000 I -        Constraints                    | tests:    4 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        INIConfigFile                  | tests:   12 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        JSONConfigFile                 | tests:   17 | fails:    0 | assert calls:          0 | time secs:  0.004
2015-09-18T10:41:18.279+0000 I -        LegacyInterface                | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        NumericalBaseParsing           | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        OptionCount                    | tests:    1 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        OptionSources                  | tests:    6 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        Parsing                        | tests:   23 | fails:    1 | assert calls:          0 | time secs:  0.000
	ImplicitValueOverride	Expected ::mongo::Status::OK() == (parser.run(testOpts, argv, env_map, &environment)) (OK  == BadValue Error parsing command line: too many positional options have been specified on the command line) @src/mongo/util/options_parser/options_parser_test.cpp:768
2015-09-18T10:41:18.279+0000 I -        Registration                   | tests:   12 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        Style                          | tests:    4 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        YAMLConfigFile                 | tests:   26 | fails:    0 | assert calls:          0 | time secs:  0.004
2015-09-18T10:41:18.279+0000 I -        TOTALS                         | tests:  132 | fails:    1 | assert calls:          0 | time secs:  0.180
2015-09-18T10:41:18.279+0000 I -        Failing tests:
2015-09-18T10:41:18.279+0000 I -        	 Parsing/ImplicitValueOverride Failed
2015-09-18T10:41:18.279+0000 I -        FAILURE - 1 tests in 1 suites failed

This is the bug in this test. This exception is expected - see the mailing list question http://lists.boost.org/boost-users/2015/09/85096.php

Documentation of boost::typed_value::implicit_value

Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: 'ovalue' or 'option=value'. Giving '-o' or '-option' will cause the implicit value to be applied. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user.

So with this args:

argv.push_back("binaryname");
argv.push_back("--port");
argv.push_back("5");

test should fail also with boost 1.56 ... !

Attached patch should fix this.



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:57:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.