VirtualBox

Changeset 14025 in vbox


Ignore:
Timestamp:
Nov 10, 2008 5:10:54 PM (16 years ago)
Author:
vboxsync
Message:

tstNoCrt-1: Added simple strcpy test.

Location:
trunk/src/VBox/Runtime/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r13472 r14025  
    271271        ../common/string/strchr.asm \
    272272        ../common/string/strcmp.asm \
     273        ../common/string/strcpy.asm \
    273274        ../common/string/strlen.asm
    274275
  • trunk/src/VBox/Runtime/testcase/tstNoCrt-1.cpp

    r9502 r14025  
    184184     * memcpy.
    185185     */
     186#if 0
    186187    RTPrintf("tstNoCrt-1: memcpy\n");
    187188    TstBufInit(&Buf1, 1);
     
    399400        TstBufCheck(&Buf1, sz);
    400401    }
     402#endif /* tmp, remove */
     403
     404    /*
     405     * strcpy (quick smoke testing).
     406     */
     407    RTPrintf("tstNoCrt-1: strcpy\n");
     408    TstBufInit(&Buf1, 1);
     409    const char *pszSrc = s_szTest1;
     410    char *pszDst = (char *)&Buf1.abBuf[0];
     411    pv = RT_NOCRT(strcpy)(pszDst, pszSrc);
     412    CHECK_PV(pszDst);
     413    TstBufCheck(&Buf1, "strcpy 1");
     414    iDiff = RT_NOCRT(strcmp)(pszDst, pszSrc); CHECK_DIFF( == );
     415
     416    pszSrc = s_szTest1;
     417    for (unsigned i = 0; i < sizeof(s_szTest1) / 2; i++)
     418    {
     419        pszSrc++;
     420        TstBufInit(&Buf1, 2);
     421        pszDst = (char *)&Buf1.abBuf[sizeof(Buf1.abBuf) - strlen(pszSrc) - 1];
     422        pv = RT_NOCRT(strcpy)(pszDst, pszSrc);
     423        CHECK_PV(pszDst);
     424        TstBufCheck(&Buf1, "strcpy 3");
     425        iDiff = RT_NOCRT(strcmp)(pszDst, pszSrc); CHECK_DIFF( == );
     426    }
     427
    401428
    402429    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette