Changeset 463


Ignore:
Timestamp:
Jul 28, 2003, 11:35:55 AM (22 years ago)
Author:
bird
Message:

Added another sprintf test.

Location:
trunk/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/Optlink-1-Asm.asm

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r462 r463  
    1717extrn OptSimple:near
    1818extrn OptPrintf:near
     19extrn _sprintf:near
    1920
    2021
     22public asmfunc
    2123asmfunc proc near
    2224    xor eax, eax
     
    2426asmfunc endp
    2527
     28;;
     29; asmsprintf(char *pszBuffer, const char* pszFormat, ...);
     30;
     31public asmsprintf
     32asmsprintf proc near
     33    push    ebp
     34    mov     ebp, esp
     35   
     36    push    eax                         ; pszBuffer
     37    push    edx                         ; pszFormat
     38    lea     eax, [ebp+010h]             ; &...
     39    push    eax
     40    call    _sprintf
     41
     42    leave
     43    ret
     44asmsprintf endp
     45
    2646CODE32 ends
    2747
  • trunk/testcase/Optlink-1.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r462 r463  
    22#include <stdarg.h>
    33#include <string.h>
     4
     5extern int _Optlink asmsprintf(char *, const char*,...);
    46
    57long _Optlink OptSimple(int arg1, int arg2, int arg3, int arg4, int arg5)
     
    5456int main(int argc, const char * const *argv)
    5557{
    56     int rc = 0;
     58    int     rc = 0;
     59    char    szBuffer[128];
    5760
    5861    if (OptSimple(0x11000011, 0x22000022, 0x33000033, 0x44000044, 0x55000055))
     
    6871    }
    6972
     73    asmsprintf(szBuffer, "%s%c%s%s", "hello", ' ', "world", "\n");
     74    if (strcmp(szBuffer, "hello world\n"))
     75    {
     76        printf("error: OptPrintf failed\n");
     77        rc++;
     78    }
     79
     80
    7081    if (!rc)
    7182        printf("All Testcases Successfully Executed\n");
Note: See TracChangeset for help on using the changeset viewer.