Update of /cvsroot/libsysio/libsysio/tests
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3306
Modified Files:
test_fhipath.c
Log Message:
Modified to use the new fhi test support goodies.
Index: test_fhipath.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_fhipath.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- test_fhipath.c 25 Feb 2009 05:08:58 -0000 1.2
+++ test_fhipath.c 17 Aug 2009 23:36:43 -0000 1.3
@@ -9,7 +9,7 @@
* terms of the GNU Lesser General Public License
* (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
*
- * Cplant(TM) Copyright 1998-2003 Sandia Corporation.
+ * Cplant(TM) Copyright 1998-2009 Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the US Government.
* Export of this program may require a license from the United States
@@ -36,7 +36,7 @@
* Lee Ward
* Sandia National Laboratories, New Mexico
* P.O. Box 5800
- * Albuquerque, NM 87185-1110
+ * Albuquerque, NM 87185-1319
*
* le...@sa...
*/
@@ -58,11 +58,12 @@
#include "xtio.h"
#include "test.h"
#include "../misc/fhi.h"
+#include "fhi_support.h"
/*
* Stat files.
*
- * Usage: test_path [export-path] [path...]
+ * Usage: test_fhipath [export-path] [path...]
*
* Without any path arguments, the program reads from standard-in, dealing with
* each line as an absolute or relative path until EOF.
@@ -85,7 +86,6 @@ main(int argc, char *const argv[])
{
int i;
int err;
- ssize_t cc;
int n;
extern int _test_sysio_startup(void);
@@ -112,27 +112,7 @@ main(int argc, char *const argv[])
if (!(argc - optind))
usage();
key = 1;
- err =
- SYSIO_INTERFACE_NAME(fhi_export)(&key,
- sizeof(key),
- argv[optind],
- 0,
- &root_handle.fhi_export);
- if (err) {
- perror(argv[optind]);
- exit(1);
- }
- cc =
- SYSIO_INTERFACE_NAME(fhi_root_of)(root_handle.fhi_export,
- &root_handle);
- if (cc < 0) {
- perror(argv[optind]);
- exit(1);
- }
- if ((size_t )cc >= sizeof(root_handle_data)) {
- (void )fprintf(stderr,
- "%s: handle data too large\n",
- argv[optind]);
+ if (_test_fhi_start(&key, argv[optind], &root_handle)) {
exit(1);
}
optind++;
@@ -207,12 +187,8 @@ statit(const char *path)
perror(path);
return -1;
}
- if ((size_t )cc >= sizeof(root_handle_data)) {
- (void )fprintf(stderr,
- "%s: handle data too large\n",
- path);
+ if (_test_fhi_check_handle(path, &handle, cc))
exit(1);
- }
err = SYSIO_INTERFACE_NAME(fhi_getattr)(&handle, &stbuf);
if (err) {
perror(path);
|