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

Changeset 802

Show
Ignore:
Timestamp:
12/13/10 02:16:19 (14 years ago)
Author:
braddr
Message:

Switch from using std.string.atoi to core.stdc.atoi. This test isn't intended to test phobos and to!int is failing on x86_64. I'll debug that separately from this test.

Files:

Legend:

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

    r575 r802  
    11// REQUIRED_ARGS: -d 
    22// EXECUTE_ARGS: 10000 
    33 
    4 import std.c.stdio
    5 import std.string
     4extern(C) int printf(const char *, ...)
     5extern(C) int atoi(const char *)
    66 
    77    int main (string[] argv) 
    88    { 
    99        string s = ""; 
    1010        int count, loop; 
    1111 
    12         count = atoi (argv [1]); 
     12        count = atoi((argv[1] ~ '\0').ptr); 
    1313        if (count == 0) 
    1414            count = 1; 
     15        printf("count = %u\n", count); 
    1516 
    1617        for (loop = 0; loop < count; loop ++) 
    1718            s ~= "hello\n"; 
    1819        for (loop = 0; loop < count; loop ++) 
    1920            s ~= "h"; 
    2021        printf ("%d\n", s.length); 
    2122    //printf("%.*s\n", s[0..100]); 
    2223    assert(s.length == count * (6 + 1)); 
    2324    s.length = 3; 
    2425    s.length = 10; 
    2526    s.length = 0; 
    2627    s.length = 1000; 
    2728        return 0; 
    2829    } 
    2930