diff options
author | joeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-06-07 18:15:34 +0000 |
---|---|---|
committer | joeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-06-07 18:15:34 +0000 |
commit | 847571c32d0e1016f99de06cf459a5f967d098bd (patch) | |
tree | 6de938ccdd8683e1164a744a19f89beaec769bf7 /PACE/tests | |
parent | c462d9b51db8026767de9f4c9a85bdda910cdf52 (diff) | |
download | ATCD-847571c32d0e1016f99de06cf459a5f967d098bd.tar.gz |
Adding simple test for the POSIX_SINGLE_PROCESS unit of functionality.
Diffstat (limited to 'PACE/tests')
-rw-r--r-- | PACE/tests/Posix_SP_Test.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/PACE/tests/Posix_SP_Test.c b/PACE/tests/Posix_SP_Test.c new file mode 100644 index 00000000000..347528951a1 --- /dev/null +++ b/PACE/tests/Posix_SP_Test.c @@ -0,0 +1,68 @@ +/* $Id$ -*- C -*- */ + +/* ===================================================================== */ +/* */ +/* = FILENAME */ +/* Posix_SP_Test.c */ +/* */ +/* = DESCRIPTION */ +/* Testing the platform for POSIX_SINGLE_PROCESS unit of */ +/* functionality. This consists of calls to sysconf, time, and */ +/* uname. This is not meant to be an exhaustive test at this */ +/* point but more a sanity check that PACE works (at least somewhat) */ +/* as advertised. */ +/* */ +/* = AUTHOR */ +/* Joe Hoffert <joeh@cs.wustl.edu> */ +/* */ +/* ===================================================================== */ + +#include "pace/unistd.h" +#include "pace/time.h" +#include "pace/sys/utsname.h" + +const char * filename = "temp"; +const char * mode = "w+"; +const char * string1 = "line 1\n"; +const char * success = "SUCCEEDED"; +const char * failure = "***FAILED***"; + +int +main (int argc, char **argv) +{ + long retval; + time_t local_time; + utsname name; + + /* Call pace_sysconf() */ + retval = pace_sysconf(_SC_2_C_BIND); + + if (retval != _POSIX2_C_BIND) { + printf("pace_sysconf %s\n", failure); + return -1; + } + + printf("pace_sysconf %s\n", success); + + /* Call pace_time() */ + retval = pace_time(&local_time); + + if (retval == -1) { + printf("pace_time %s\n", failure); + return -1; + } + + printf("pace_time %s\n", success); + + /* Call pace_uname() */ + retval = pace_uname(&name); + + if (retval <= -1) { + printf("pace_uname %s\n", failure); + return -1; + } + + printf("pace_uname %s\n", success); + + return 0; +} |