Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

time_util_good.c

Go to the documentation of this file.
00001 /*
00002  * time_util_good.c
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file time_util_good.c
00014  *
00015  * Test function in time_util.h with good inputs.
00016  */
00017 
00018 #include "config.h"
00019 
00020 #ifndef DEBUG
00021 #define DEBUG
00022 #endif
00023 
00024 #include <sys/types.h>
00025 #include <sys/time.h>
00026 
00027 #include <assert.h>
00028 #include <assert_pp.h>
00029 
00030 #include "time_util.h"
00031 
00032 int main(int argc, char *argv[])
00033 {
00034     unsigned long long us;
00035     
00036     assert(string_to_microsec(&us, "10"));
00037     assert(us == 10);
00038 
00039     assert(string_to_microsec(&us, "10us"));
00040     assert(us == 10);
00041 
00042     assert(string_to_microsec(&us, "10ms"));
00043     assert(us == 10000);
00044 
00045     assert(string_to_microsec(&us, "10s"));
00046     assert(us == 10000000);
00047 
00048     assert(string_to_microsec(&us, "10m"));
00049     assert(us == 600000000);
00050 
00051     return( EXIT_SUCCESS );
00052 }

Generated on Fri Oct 22 07:50:25 2004 for CPU Broker by  doxygen 1.3.9.1