|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 0252 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 0252.
Report 0252 Actions
Problem Report Number 0252 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0252 Raised 1996-04-15 08:00 Updated 2003-03-13 08:00 Published 1996-04-22 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSX4 version 4.3.5 Test Identification XPG4.os/wstring/wcscpy 1 Problem Summary TSD4.252 This test may fail on all implementations. The test has two defects, both in the preparetests() function. 1. The following is the intended strategy to test for copying of excess characters by wcscpy()... Problem Text
This test may fail on all implementations.
The test has two defects, both in the preparetests() function.
1. The following is the intended strategy to test for copying of excess
characters by wcscpy():
a. copy contents of the destination area,referenced by wsto,
to a separate expected result area referenced by expws.
b. copy the shortened source string to the area referenced
by expws.
c. use wcscpy() to copy the shortened source string from wsfrom to wsto.
d. compare the contents of expws and wsto after the wcscpy(). The contents
of the two areas should be identical.
/*
* Copy source string to a separate buffer for checking results
* Copy the full destination string, then the shortened source
* string so that copying too many chars can be checked for.
*/
for (i = 0, wcp1 = wsto, wcp2 = expws; i < wslen; i++)
{
if (i == 0)
PATH_TRACE;
*wcp2++ = *wcp1++;
}
*wcp2 = (wchar_t) '\0';
The above code fragment copies the first wslen wide characters
from the area referenced by wsto to the area referenced by expws.
Then, expws[wslen] is assigned the value (wchar_t)0;
Subsequently the test compares the contents of wsto[0] thru wsto[wslen]
with the contents of expws[0] thru expws[wslen].
Since the area referenced by wsto has been obtained by calling malloc()
and has not been subsequently initialized, this creates a possibility
that expws[wslen] does not equal wsto[wslen].
The contents of the memory returned by malloc() are indeterminate.
As coded currently, the test will fail whenenver the contents of
wsto[wslen] are not (wchar_t)0.
This test deficiencly can be corrected by either initializing
wsto[wslen] to (wchar_t)0 as shown below, or by copying wsto[wslen]
to expsws[wslen].
***************
*** 200,206 ****
PATH_TRACE;
*wcp2++ = *wcp1++;
}
! *wcp2 = (wchar_t) '\0'; *wcp1 = (wchar_t) '\0'; /* Fix */
cutlen = wslen / 3;
for (i = 0, wcp1 = wsfrom, wcp2 = expws; i < cutlen; i++)
--- 200,206 ----
PATH_TRACE;
*wcp2++ = *wcp1++;
}
! *wcp2 = (wchar_t) '\0';
cutlen = wslen / 3;
for (i = 0, wcp1 = wsfrom, wcp2 = expws; i < cutlen; i++)
2. Given a wide character string of length < 3, lines 167 thru 173
in wcscpy.c attempt to pad it up to a string of length three by
copying over the last non-null (wchar_t). This is being done
incorrectly as shown by the following code fragments.
*** 167,173 ****
if(wslen < 3)
{
for(; wslen < 3; wslen++)
! wsfrom[wslen] = wsfrom[wslen-1]; /* Fix */
wsfrom[wslen] = (wchar_t)0;
}
--- 167,173 ----
if(wslen < 3)
{
for(; wslen < 3; wslen++)
! wsfrom[wslen] = wsfrom[wslen];
wsfrom[wslen] = (wchar_t)0;
}Test Output
/tset/XPG4.os/wstring/wcscpy/T.wcscpy 1 Failed
Test Description:
A call to wcscpy() copies the wide string s2 to s1 stopping after the
null wide character has been copied and returns s1.
Test Strategy:
OBTAIN a sample string of wide characters by calling the routine
wcharstr().
SET the locale for LC_ALL to the LOCALE1 parameter.
VERIFY that a wide-character string of ordinary character values is
correctly copied.
VERIFY that a wide-character string is correctly copied.
Test Information:
wcscpy did not copy data correctly
expected result : .
actual result : .Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
It is accepted that the test failure is caused by a Test Suite Deficiency and
it is recommended that a waiver is granted.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 0252
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority