Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-510

locale tests assert and abort when passed --help command line argument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.2.0
    • Component/s: Tests
    • Labels:
      None

      Description

      Running many of the locale tests with the '--help' command line argument results in an assertion error and then immediate program termination. This makes it difficult to tell what command line options are available. A test that shows this problem is 22.locale.time.put.mt.cpp.

      This is because the rw_opt_setlocales function in locales.cpp doesn't handle the case where the first argument is NULL. This is the case when the --help command line argument exists. Most of the other rw_opt_... methods have a test like this near the top of the file.

      if (1 == argc && argv && 0 == argv [0]) {
      }

      If the test passes, argv[0] will be set to the help string that should be used.

        Attachments

          Activity

            People

            • Assignee:
              sebor Martin Sebor
              Reporter:
              vitek Travis Vitek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: