brbzull0 commented on code in PR #13862: URL: https://github.com/apache/trafficserver/pull/13862#discussion_r4335025101
########## include/tscore/ArgParser.h: ########## @@ -364,6 +394,14 @@ class ArgParser // Enable test mode - makes do_exit() throw instead of calling exit() for unit testing static void set_test_mode(bool test = true); + /** Clear the parser-wide state held at file scope in ArgParser.cc. + + Test-only. A program builds one parser and never reuses the state, but a unit test binary + runs many parsers in sequence, and set_default_command() or Command::set_default() would + otherwise leak default_command into every later test. + */ + static void reset_global_state(); Review Comment: No change, as in https://github.com/apache/trafficserver/pull/13862#discussion_r4314360496: `reset_global_state()` is declared under the `protected:` label of `ArgParser`, and `tscore` headers are not installed; the tests reach it through the derived `Access` shim. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
