summaryrefslogtreecommitdiffstats
path: root/tools/h5import
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-09-24 21:13:49 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-09-24 21:13:49 (GMT)
commit66698746984365e58e6d2848721fc24e415c676e (patch)
tree1fabfa504bed3a2db5f1641651e7531bdace31eb /tools/h5import
parentf1b33ea5788498597d86d051a328183e32f8c02c (diff)
downloadhdf5-66698746984365e58e6d2848721fc24e415c676e.zip
hdf5-66698746984365e58e6d2848721fc24e415c676e.tar.gz
hdf5-66698746984365e58e6d2848721fc24e415c676e.tar.bz2
[svn-r15694] 1)
Bug fix #1281 The TEXTFPE was described in the usage (read floats in scientific notation) but was not implemeneted. Solution: remove TEXTFPE from the help system and have the TEXTFPE input type do the same thing as TEXTPF currently does to support backwards compatibility (the format read for both TEXTFPE and TEXTPF is %f) added a test 2) renamed configuration files to have the extension .conf tested: windows, linux
Diffstat (limited to 'tools/h5import')
-rwxr-xr-xtools/h5import/h5import.c29
-rwxr-xr-xtools/h5import/h5importtest.c5
-rwxr-xr-xtools/h5import/h5importtestutil.sh19
-rw-r--r--tools/h5import/testfiles/in64.txt2
-rw-r--r--tools/h5import/testfiles/test15.h5bin0 -> 2064 bytes
-rwxr-xr-xtools/h5import/testfiles/textfp32.conf (renamed from tools/h5import/testfiles/textfp32)0
-rwxr-xr-xtools/h5import/testfiles/textfp64.conf (renamed from tools/h5import/testfiles/textfp64)0
-rwxr-xr-xtools/h5import/testfiles/textin16.conf (renamed from tools/h5import/testfiles/textin16)0
-rwxr-xr-xtools/h5import/testfiles/textin32.conf (renamed from tools/h5import/testfiles/textin32)0
-rwxr-xr-xtools/h5import/testfiles/textin8.conf (renamed from tools/h5import/testfiles/textin8)0
-rw-r--r--tools/h5import/testfiles/textpfe.conf11
-rwxr-xr-xtools/h5import/testfiles/textuin16.conf (renamed from tools/h5import/testfiles/textuin16)0
-rwxr-xr-xtools/h5import/testfiles/textuin32.conf (renamed from tools/h5import/testfiles/textuin32)0
13 files changed, 52 insertions, 14 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 2d19d95..4b24223 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -719,7 +719,19 @@ readFloatData(FILE **strm, struct Input *in)
fp32 = (H5DT_FLOAT32 *) in->data;
break;
+ /* same as TEXTFP */
case 2: /*TEXTFPE */
+
+ for (i = 0; i < len; i++, fp32++)
+ {
+ if (fscanf(*strm, "%f", fp32) != 1)
+ {
+ (void) fprintf(stderr, err1);
+ return (-1);
+ }
+ }
+
+ fp32 = (H5DT_FLOAT32 *) in->data;
break;
case 3: /* FP */
@@ -756,7 +768,19 @@ readFloatData(FILE **strm, struct Input *in)
fp64 = (H5DT_FLOAT64 *) in->data;
break;
+ /* same as TEXTFP */
case 2: /*TEXTFPE */
+
+ for (i = 0; i < len; i++, fp64++)
+ {
+ if (fscanf(*strm, "%lf", fp64) != 1)
+ {
+ (void) fprintf(stderr, err1);
+ return (-1);
+ }
+ }
+
+ fp64 = (H5DT_FLOAT64 *) in->data;
break;
case 3: /* FP */
@@ -2678,7 +2702,7 @@ help(char *name)
(void) fprintf(stdout, "\t to be created.\n\n");
(void) fprintf(stdout, "\t INPUT-CLASS:\n");
(void) fprintf(stdout, "\t String denoting the type of input data.\n");
- (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"TEXTFPE\", \"FP\", \"IN\", \n");
+ (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n");
(void) fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n");
(void) fprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n");
(void) fprintf(stdout, "\t file with signed integer data in ASCII form,\n");
@@ -2687,9 +2711,6 @@ help(char *name)
(void) fprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n");
(void) fprintf(stdout, "\t floating point data in the fixed notation\n");
(void) fprintf(stdout, "\t (325.34),\n");
- (void) fprintf(stdout, "\t \"TEXTFPE\" denotes an ASCII text file containing\n");
- (void) fprintf(stdout, "\t floating point data in the scientific notation\n");
- (void) fprintf(stdout, "\t (3.2534E+02),\n");
(void) fprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n");
(void) fprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n");
(void) fprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n");
diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c
index 7a6bbff..3c82e81 100755
--- a/tools/h5import/h5importtest.c
+++ b/tools/h5import/h5importtest.c
@@ -29,6 +29,7 @@
* Define names for test files
*/
+
int
main(void)
{
@@ -172,7 +173,7 @@ main(void)
#ifndef UNICOS
- sp = fopen("txtin16", "w");
+ sp = fopen("in16.txt", "w");
for (k = 0; k < npln; k++)
for (i = 0; i < nrow; i++)
{
@@ -182,7 +183,7 @@ main(void)
}
(void) fclose(sp);
- sp = fopen("txtin32", "w");
+ sp = fopen("in32.txt", "w");
for (k = 0; k < npln; k++)
for (i = 0; i < nrow; i++)
{
diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh
index 0687871..4f5a7bb 100755
--- a/tools/h5import/h5importtestutil.sh
+++ b/tools/h5import/h5importtestutil.sh
@@ -60,25 +60,25 @@ cp $srcdir/testfiles/*.h5 tmp_testfiles/
$RUNSERIAL ./h5importtest
TESTING "ASCII I32 rank 3 - Output BE " ;
-TOOLTEST txtin32 -c $srcdir/testfiles/textin32 -o test1.h5
+TOOLTEST in32.txt -c $srcdir/testfiles/textin32.conf -o test1.h5
TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended"
-TOOLTEST txtin16 -c $srcdir/testfiles/textin16 -o test2.h5
+TOOLTEST in16.txt -c $srcdir/testfiles/textin16.conf -o test2.h5
TESTING "ASCII I8 - rank 3 - Output I16 LE-Chunked+Extended+Compressed "
-TOOLTEST txtin16 -c $srcdir/testfiles/textin8 -o test3.h5
+TOOLTEST in16.txt -c $srcdir/testfiles/textin8.conf -o test3.h5
TESTING "ASCII UI32 - rank 3 - Output BE"
-TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin32 -o test4.h5
+TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin32.conf -o test4.h5
TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed "
-TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin16 -o test5.h5
+TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin16.conf -o test5.h5
TESTING "ASCII F32 - rank 3 - Output LE "
-TOOLTEST $srcdir/testfiles/fp1 -c $srcdir/testfiles/textfp32 -o test6.h5
+TOOLTEST $srcdir/testfiles/fp1 -c $srcdir/testfiles/textfp32.conf -o test6.h5
TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed "
-TOOLTEST $srcdir/testfiles/fp2 -c $srcdir/testfiles/textfp64 -o test7.h5
+TOOLTEST $srcdir/testfiles/fp2 -c $srcdir/testfiles/textfp64.conf -o test7.h5
TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed "
TOOLTEST bfp64 -c $srcdir/testfiles/conbfp64 -o test8.h5
@@ -101,7 +101,10 @@ TOOLTEST buin32 -c $srcdir/testfiles/conbuin32 -o test13.h5
TESTING "STR"
TOOLTEST $srcdir/testfiles/txtstr -c $srcdir/testfiles/textstr -o teststr.h5
-rm -f tx* b* *.dat
+TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE "
+TOOLTEST $srcdir/testfiles/in64.txt -c $srcdir/testfiles/textpfe.conf -o test15.h5
+
+rm -f tx* b* *.dat *.txt
rm -f test*.h5
rm -rf tmp_testfiles
else
diff --git a/tools/h5import/testfiles/in64.txt b/tools/h5import/testfiles/in64.txt
new file mode 100644
index 0000000..f6dd7f4
--- /dev/null
+++ b/tools/h5import/testfiles/in64.txt
@@ -0,0 +1,2 @@
+6.02E+24
+3.14159265E+00
diff --git a/tools/h5import/testfiles/test15.h5 b/tools/h5import/testfiles/test15.h5
new file mode 100644
index 0000000..73a157c
--- /dev/null
+++ b/tools/h5import/testfiles/test15.h5
Binary files differ
diff --git a/tools/h5import/testfiles/textfp32 b/tools/h5import/testfiles/textfp32.conf
index 9696a7f..9696a7f 100755
--- a/tools/h5import/testfiles/textfp32
+++ b/tools/h5import/testfiles/textfp32.conf
diff --git a/tools/h5import/testfiles/textfp64 b/tools/h5import/testfiles/textfp64.conf
index fbab6a6..fbab6a6 100755
--- a/tools/h5import/testfiles/textfp64
+++ b/tools/h5import/testfiles/textfp64.conf
diff --git a/tools/h5import/testfiles/textin16 b/tools/h5import/testfiles/textin16.conf
index d2d11c3..d2d11c3 100755
--- a/tools/h5import/testfiles/textin16
+++ b/tools/h5import/testfiles/textin16.conf
diff --git a/tools/h5import/testfiles/textin32 b/tools/h5import/testfiles/textin32.conf
index ca4802a..ca4802a 100755
--- a/tools/h5import/testfiles/textin32
+++ b/tools/h5import/testfiles/textin32.conf
diff --git a/tools/h5import/testfiles/textin8 b/tools/h5import/testfiles/textin8.conf
index 4405338..4405338 100755
--- a/tools/h5import/testfiles/textin8
+++ b/tools/h5import/testfiles/textin8.conf
diff --git a/tools/h5import/testfiles/textpfe.conf b/tools/h5import/testfiles/textpfe.conf
new file mode 100644
index 0000000..69fd8c8
--- /dev/null
+++ b/tools/h5import/testfiles/textpfe.conf
@@ -0,0 +1,11 @@
+PATH /test
+INPUT-CLASS TEXTFPE
+INPUT-SIZE 64
+RANK 1
+DIMENSION-SIZES 2
+OUTPUT-CLASS FP
+OUTPUT-SIZE 64
+
+
+
+
diff --git a/tools/h5import/testfiles/textuin16 b/tools/h5import/testfiles/textuin16.conf
index 753e6e8..753e6e8 100755
--- a/tools/h5import/testfiles/textuin16
+++ b/tools/h5import/testfiles/textuin16.conf
diff --git a/tools/h5import/testfiles/textuin32 b/tools/h5import/testfiles/textuin32.conf
index d61e1a1..d61e1a1 100755
--- a/tools/h5import/testfiles/textuin32
+++ b/tools/h5import/testfiles/textuin32.conf