Issue Details (XML | Word | Printable)

Key: STDCXX-638
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Farid Zaripov
Reporter: Farid Zaripov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[MSVC] 21.cwctype test fails

Created: 02/Nov/07 03:47 PM   Updated: 17/Apr/08 10:41 AM
Return to search
Component/s: Tests
Affects Version/s: 4.2.0
Fix Version/s: 4.2.1

Time Tracking:
Original Estimate: 1h
Original Estimate - 1h
Remaining Estimate: 0h
Time Spent - 1h
Time Spent: 1h
Time Spent - 1h

File Attachments:
  Size
File Licensed for inclusion in ASF works 21.cwctype.cpp.diff 2008-04-02 11:09 AM Farid Zaripov 5 kB
Environment: MSVC, ICC/Windows
Issue Links:
Reference
 

Patch Info: Patch Available
Severity: Incorrect Behavior
Resolution Date: 04/Apr/08 07:45 AM


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Farid Zaripov added a comment - 02/Apr/08 10:48 AM
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)


Farid Zaripov added a comment - 02/Apr/08 11:09 AM
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.

Martin Sebor added a comment - 04/Apr/08 03:41 AM
Your patch looks good to me, thanks!

Farid Zaripov added a comment - 04/Apr/08 07:45 AM
Fixed thus: http://svn.apache.org/viewvc?rev=644632&view=rev
Will be closed after merging the patch into 4.2.x branch.

Farid Zaripov added a comment - 17/Apr/08 10:41 AM