Details

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

      MSVC, ICC/Windows

    • Patch Info:
      Patch Available
    • Severity:
      Incorrect Behavior

      Description

      The 21.cwctype.cpp test fails with the following assertions:

      -----------

      1. ASSERTION (S7) (4 lines):
      2. TEXT: std::wctype (const char*) not defined
      3. CLAUSE: lib.c.strings
      4. LINE: 873
      1. ASSERTION (S7) (4 lines):
      2. TEXT: std::wctrans (const char*) not defined
      3. CLAUSE: lib.c.strings
      4. LINE: 899
      1. ASSERTION (S7) (4 lines):
      2. TEXT: std::towctrans(wint_t, wctrans_t) not defined
      3. CLAUSE: lib.c.strings
      4. LINE: 909
        -----------

      Also there are number of assertions like this:
      ----------

      1. ASSERTION (S7) (3 lines):
      2. TEXT: ' ' mask extra bits print (0x40)
      3. CLAUSE: lib.c.strings
        ----------

      In the latter the test expects that iswctype() returns 0 for the characters > 127 (because in the char_mask [256] array initialized only first 128 elements), but actually this is not true.

        Issue Links

          Activity

          Hide
          Farid Zaripov added a comment -

          The first three assertions could be replaced with rw_warn if _RWSTD_STRICT_ANSI macro is not defined.

          As for the other assertions: the C99 standard doesn't requires that iswxxx() should return the same values, as corresponding isxxx() (see this comment in STDCXX-660)

          Show
          Farid Zaripov added a comment - The first three assertions could be replaced with rw_warn if _RWSTD_STRICT_ANSI macro is not defined. As for the other assertions: the C99 standard doesn't requires that iswxxx() should return the same values, as corresponding isxxx() (see this comment in STDCXX-660 )
          Hide
          Farid Zaripov added a comment -

          The proposed patch is attached.

          ChangeLog:

          • tests/strings/21.cwctype.cpp (test_behavior): Don't check the extra bits since C99 standard
            implicitly allows defining extra bits in iswxxx().
            (run_test): Use rw_warn() instead of rw_assert() when _RWSTD_STRICT_ANSI macro is not
            #defined when testing the masking macros and presence of the standard C functions in CRT.
          Show
          Farid Zaripov added a comment - The proposed patch is attached. ChangeLog: tests/strings/21.cwctype.cpp (test_behavior): Don't check the extra bits since C99 standard implicitly allows defining extra bits in iswxxx(). (run_test): Use rw_warn() instead of rw_assert() when _RWSTD_STRICT_ANSI macro is not #defined when testing the masking macros and presence of the standard C functions in CRT.
          Hide
          Martin Sebor added a comment -

          Your patch looks good to me, thanks!

          Show
          Martin Sebor added a comment - Your patch looks good to me, thanks!
          Hide
          Farid Zaripov added a comment -

          Fixed thus: http://svn.apache.org/viewvc?rev=644632&view=rev
          Will be closed after merging the patch into 4.2.x branch.

          Show
          Farid Zaripov added a comment - Fixed thus: http://svn.apache.org/viewvc?rev=644632&view=rev Will be closed after merging the patch into 4.2.x branch.
          Hide
          Farid Zaripov added a comment -
          Show
          Farid Zaripov added a comment - Merged in 4.2.x branch thus: http://svn.apache.org/viewvc?view=rev&revision=648752

            People

            • Assignee:
              Farid Zaripov
              Reporter:
              Farid Zaripov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                  Development