Changeset 2d11a7d8 in mainline for uspace/app/tester/ipc/ping_pong.c


Ignore:
Timestamp:
2009-06-30T15:54:14Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c40f88
Parents:
db24058
Message:

tester framework rewrite (go from a menu-driven interface to command-line interface)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/ipc/ping_pong.c

    rdb24058 r2d11a7d8  
    3838#define COUNT_GRANULARITY  100
    3939
    40 char *test_ping_pong(bool quiet)
     40char *test_ping_pong(void)
    4141{
    42         printf("Pinging ns server for %d seconds...\n", DURATION_SECS);
     42        TPRINTF("Pinging ns server for %d seconds...", DURATION_SECS);
    4343       
    4444        struct timeval start;
    45         if (gettimeofday(&start, NULL) != 0)
    46                 return "Failed getting the time.";
     45        if (gettimeofday(&start, NULL) != 0) {
     46                TPRINTF("\n");
     47                return "Failed getting the time";
     48        }
    4749       
    4850        uint64_t count = 0;
    49        
    5051        while (true) {
    5152                struct timeval now;
    52                 if (gettimeofday(&now, NULL) != 0)
    53                         return "Failed getting the time.";
     53                if (gettimeofday(&now, NULL) != 0) {
     54                        TPRINTF("\n");
     55                        return "Failed getting the time";
     56                }
    5457               
    5558                if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L)
     
    6063                        int retval = async_req_0_0(PHONE_NS, NS_PING);
    6164                       
    62                         if (retval != EOK)
    63                                 return "Failed to send ping message.";
     65                        if (retval != EOK) {
     66                                TPRINTF("\n");
     67                                return "Failed to send ping message";
     68                        }
    6469                }
    6570               
     
    6772        }
    6873       
    69         printf("Completed %lu round trips in %u seconds, %lu RT/s.\n",
     74        TPRINTF("OK\nCompleted %llu round trips in %u seconds, %llu rt/s.\n",
    7075            count, DURATION_SECS, count / DURATION_SECS);
    7176       
Note: See TracChangeset for help on using the changeset viewer.