Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 766

Show
Ignore:
Timestamp:
11/20/10 07:42:41 (14 years ago)
Author:
braddr
Message:

Fix two bad uses of printf. Recent path changes tickled them enough to cause failures.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/runnable/hello.d

    r542 r766  
    11// PERMUTE_ARGS:  
    22 
    33extern(C) int printf(const char*, ...); 
    44 
    55int main(char[][] args) 
    66{ 
    77    printf("hello world\n"); 
    88    printf("args.length = %d\n", args.length); 
    99    for (int i = 0; i < args.length; i++) 
    10     printf("args[%d] = '%s'\n", i, cast(char *)args[i]); 
     10    printf("args[%d] = '%.*s'\n", i, args[i].length, args[i].ptr); 
    1111    return 0; 
    1212} 
  • trunk/test/runnable/hello-profile.d

    r623 r766  
    11// PERMUTE_ARGS:  
    22// REQUIRED_ARGS: -profile 
    33// POST_SCRIPT: runnable/extra-files/hello-profile-postscript.sh 
    44 
    55module hello; 
    66 
    77extern(C) 
    88{ 
    99    int printf(const char*, ...); 
    1010    int trace_setlogfilename(string name); 
    1111    int trace_setdeffilename(string name); 
    1212} 
    1313 
    1414void showargs(char[][] args) 
    1515{ 
    1616    printf("hello world\n"); 
    1717    printf("args.length = %d\n", args.length); 
    1818    for (int i = 0; i < args.length; i++) 
    19     printf("args[%d] = '%s'\n", i, cast(char *)args[i]); 
     19    printf("args[%d] = '%.*s'\n", i, args[i].length, args[i].ptr); 
    2020} 
    2121 
    2222int main(char[][] args) 
    2323{ 
    2424    trace_setlogfilename("test_results/runnable/hello-profile.d.trace.log"); 
    2525    trace_setdeffilename("test_results/runnable/hello-profile.d.trace.def"); 
    2626 
    2727    showargs(args); 
    2828 
    2929    return 0; 
    3030} 
    3131