including openisis 0.9.0 into webpac tree
[webpac] / openisis / tcl / test / test1.087.tcl
diff --git a/openisis/tcl/test/test1.087.tcl b/openisis/tcl/test/test1.087.tcl
new file mode 100755 (executable)
index 0000000..e1fd6a8
--- /dev/null
@@ -0,0 +1,69 @@
+#!/opt/openisis/tcl/tclbuild/tclsh
+#
+#      openisis - an open implementation of the ISIS database
+#      Version 0.8.x (microversion see file Version)
+#      Copyright (C) 2003 by Erik Grziwotz, erik@openisis.org
+#
+#      This library is free software; you can redistribute it and/or
+#      modify it under the terms of the GNU Lesser General Public
+#      License as published by the Free Software Foundation; either
+#      version 2.1 of the License, or (at your option) any later version.
+#
+#      This library is distributed in the hope that it will be useful,
+#      but WITHOUT ANY WARRANTY; without even the implied warranty of
+#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#      Lesser General Public License for more details.
+#
+#      You should have received a copy of the GNU Lesser General Public
+#      License along with this library; if not, write to the Free Software
+#      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#      This software is dedicated to the memory of Eckart Dietrich.
+#
+#      This software is inspired by (but contains no code of) the iAPI
+#      Copyright (C) 2000 by Robert Janusz, rj@jezuici.krakow.pl.
+#      See iAPI.txt for what it contains.
+#
+#      $Id: test1.087.tcl,v 1.1 2003/03/06 16:01:47 mawag Exp $
+#      test script for tcl-binding of openisis
+
+# openIsisLog 9 /opt/openisis/tcl/test/test1.log
+# openIsisLog v
+
+set ses0 [openIsisInit]
+puts $ses0
+
+set db1 [openIsisOpen /opt/openisis/db/cds/cds]
+
+puts $db1
+
+# $db1 check
+
+set maxrow [$db1 maxrowid -s $ses0]
+# set maxrow [$db1 maxrowid]
+puts $maxrow
+
+if 0 {
+set i 0
+while {$maxrow > $i} {
+       set rec [$db1 r $i -s $ses0]
+       puts "$i -> $rec"
+       incr i
+}
+}
+
+# set rs1 [$db1 query Micropolitan]
+set rs1 [$db1 query Africa]
+set rs1s [$rs1 size]
+puts "$rs1 total = $rs1s"
+set i 0
+while {$rs1s > $i} {
+       set rid [$rs1 next]
+       set rec [$rs1 get $i]
+       puts "found $i -> $rid -> $rec"
+       incr i
+}
+
+$rs1 cl
+$db1 cl
+