summaryrefslogtreecommitdiffstats
path: root/insertutils/test
diff options
context:
space:
mode:
Diffstat (limited to 'insertutils/test')
-rw-r--r--insertutils/test/test_insertppm.log70
-rw-r--r--insertutils/test/test_insertppm.log.reference69
-rw-r--r--insertutils/test/test_insertppm.log.save70
-rw-r--r--insertutils/test/test_insertppm.sh152
4 files changed, 361 insertions, 0 deletions
diff --git a/insertutils/test/test_insertppm.log b/insertutils/test/test_insertppm.log
new file mode 100644
index 0000000..e9f7c29
--- /dev/null
+++ b/insertutils/test/test_insertppm.log
@@ -0,0 +1,70 @@
+./test_insertppm.sh: testing insertppm start
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+exit code 255
+exit code 255
+./test_insertppm.sh: testing insertppm done
diff --git a/insertutils/test/test_insertppm.log.reference b/insertutils/test/test_insertppm.log.reference
new file mode 100644
index 0000000..31355a5
--- /dev/null
+++ b/insertutils/test/test_insertppm.log.reference
@@ -0,0 +1,69 @@
+./test_insertppm.sh: testing insertppm start
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+exit code 255
+exit code 255
diff --git a/insertutils/test/test_insertppm.log.save b/insertutils/test/test_insertppm.log.save
new file mode 100644
index 0000000..e9f7c29
--- /dev/null
+++ b/insertutils/test/test_insertppm.log.save
@@ -0,0 +1,70 @@
+./test_insertppm.sh: testing insertppm start
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+Usage: ../insertppm [-h|--help|-c <name>|--collection <name>] [options] files...
+Options:
+ -h, --help this help
+ -c, --collection <name> collection to store image; will be created if nonexistent (required)
+ -t, --type <t> store as pixel type t where t is one of: bin, grey, color (default: color)
+ -r, --rescale rescale pixel values to 8 bit = 0:255 (default: no rescale)
+ --tiled <t> store object in tiles of size t where t = [min0:max0,min1:max1,...,minn:maxn] (default: 1 tile)
+ -s, --server <name> server host (default: localhost)
+ --port <p> server port (default: 7001)
+ -d, --database <name> database name (default: RASBASE)
+ -u, --user <name> user name (default: rasguest)
+ -p, --passwd <passwd> password (default: rasguest)
+
+ --transferformat <fmt> transfer format. default: Array)
+ --transferformatparams <params> transfer format parameters.(default: '')
+ --storageformat <fmt> storage format (default: Array)
+ --storageformatparams <params> storage format parameters.(default: '')
+ -v, --verbose be verbose (default: be brief)
+Note: If one file is passed, then a 2D object will be generated.
+ If several files are passed, then a 3D object will be generated (in the sequence passed),
+ In this case all files must have same pixel type and x/y extent.
+exit code 254
+exit code 255
+exit code 255
+./test_insertppm.sh: testing insertppm done
diff --git a/insertutils/test/test_insertppm.sh b/insertutils/test/test_insertppm.sh
new file mode 100644
index 0000000..5250a48
--- /dev/null
+++ b/insertutils/test/test_insertppm.sh
@@ -0,0 +1,152 @@
+#!/bin/bash
+####################### Makefile header ##########################
+#
+# test_insertppm: test insertppm, rasgeo ppm import utility
+#
+# TEST CANDIDATE:
+# insertppm
+#
+# TEST MODE:
+# automatic
+#
+# PREREQUISITES:
+# - rasdaman server (RNP, RPC) running, any base DBMS
+# - ~rasdaman/images accessible with standard imagery
+#
+# CHANGE HISTORY (append further entries):
+# when: who: what:
+# ----------------------------------------------------------------
+# 2005-dec-02 PB created
+#
+# COMMENTS:
+# - exit -1 if "ERROR" found in log file or in diff to canonical log file
+# - test program must be in cwd
+# - old log is saved to <logfile>.save
+# - todo:
+# test storage and transfer parameters
+#
+# Copyright (C) 2005 Dr. Peter Baumann
+#
+##################################################################
+
+# --- declarations -----------------------------------------------
+
+# shorthands and orga stuff
+IPPM=../insertppm
+
+PROG=`basename $0`
+INDENT="+++ "
+
+# ERROR keyword, should be standardised across all rasdaman tests
+ERROR=ERROR
+
+# log file output
+LOG=`basename $0 .sh`.log
+
+# reference log file
+REFLOG=$LOG.reference
+
+# save old log here if it exists
+SAVELOG=$LOG.save
+
+# test defaults:
+COLL_RGB=rgb
+COLL_GREY=mr
+COLL_3D=mr3d
+FILEPATH=~rasdaman/images
+FILE_RGB=$FILEPATH/anthur.ppm
+FILE_GREY=$FILEPATH/mr_1.pgm
+FILE_LIST=$FILEPATH/mr_?.pgm
+TYPE_GREY=grey
+TYPE_RGB=color
+TILED_3D=[1:2,3:4,5:6]
+
+SERVER=`hostname`
+PORT=7001
+DATABASE=RASBASE
+USER=rasadmin
+PASSWD=rasadmin
+
+TRANSFERFORMAT=TIFF
+TRANSFERFORMATPARAMS=TIFF_PARAMS
+STORAGEFORMAT=RLE
+STORAGEFORMATPARAMS=RLE_PARAMS
+
+# --- action -----------------------------------------------
+
+# save old log if present
+if [ -f $LOG ]
+then
+ echo found old log file, shifting it to $SAVELOG
+ mv $LOG $SAVELOG
+fi
+echo "$0: testing insertppm start" | tee $LOG
+
+echo $INDENT $INDENT starting softly
+echo $INDENT no params
+( $IPPM || (export RC=$?; echo exit code $RC) ) | tee -a $LOG
+
+echo $INDENT call help
+( $IPPM -h || (export RC=$?; echo exit code $RC) ) | tee -a $LOG
+
+echo $INDENT call help
+( $IPPM --help || (export RC=$?; echo exit code $RC) ) | tee -a $LOG
+
+echo $INDENT all correct
+echo $INDENT $INDENT all mandatory syntactically correct
+# ( $IPPM -c $COLL_RGB $FILE_RGB || (export RC=$?; echo Fatal $ERROR, exit code $RC) ) | tee -a $LOG
+
+echo $INDENT $INDENT all syntactically correct, long version,
+# ( $IPPM --collection $COLL_3D --type $TYPE_GREY --rescale --tiled $TILED_3D --verbose \
+# --server $SERVER --port $PORT --database $DATABASE --user $USER --passwd $PASSWD \
+# `ls $FILE_LIST` || (export RC=$?; echo Fatal $ERROR, exit code $RC) ) | tee -a $LOG
+
+echo collection param missing:
+( $IPPM $FILE_RGB \
+ || (export RC=$?; echo exit code $RC) ) | tee -a $LOG
+echo file param missing:
+( $IPPM --collection $COLL_RGB \
+ || (export RC=$?; echo exit code $RC) ) | tee -a $LOG
+
+echo $INDENT $INDENT starting softly done
+echo $INDENT $INDENT illegal cmd line options start
+
+echo $INDENT $INDENT mdd domain parameter syntax mismatch
+
+echo tbd.
+
+echo $INDENT $INDENT illegal cmd line options done
+echo
+echo $INDENT $INDENT image type bool
+echo $INDENT $INDENT $INDENT nontiled
+echo tbd.
+echo $INDENT $INDENT $INDENT tiled
+echo tbd.
+echo $INDENT $INDENT image type grey
+echo $INDENT $INDENT $INDENT nontiled
+echo tbd.
+echo $INDENT $INDENT $INDENT tiled
+echo tbd.
+echo $INDENT $INDENT image type rgb
+echo $INDENT $INDENT $INDENT nontiled
+echo tbd.
+echo $INDENT $INDENT $INDENT tiled
+echo tbd.
+
+echo $INDENT $INDENT transfer and storage parameters
+echo tbd.
+
+# --- now compare result with canonical log:
+
+if [ `diff $LOG $REFLOG | wc -l` -ne "0" ]
+then
+ echo $0: $ERROR: log file differes from reference log file, please examine!
+ exit -1
+else
+ echo $0: no difference found between log and reference log
+fi
+
+echo "$0: testing insertppm done" >>$LOG
+echo "$0: done."
+
+