including openisis 0.9.0 into webpac tree
[webpac] / openisis / tcl / test / testfdt.tcl
diff --git a/openisis/tcl/test/testfdt.tcl b/openisis/tcl/test/testfdt.tcl
new file mode 100755 (executable)
index 0000000..5bd96c0
--- /dev/null
@@ -0,0 +1,55 @@
+#!/opt/openisis/tcl/bin/isish
+#
+#      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: testfdt.tcl,v 1.1 2003/05/03 16:40:47 mawag Exp $
+#      test script for reading fdt from metadb
+
+set syspath /opt/openisis/db/mlcm/ADB
+set db adb
+set df ISISMARC/fdttest
+
+set stb0 [openIsis syspath $syspath]
+
+set cfg [$stb0 .req .config]
+$cfg add fdt $df
+
+$stb0 req type open db $db
+$stb0 .req delete
+
+set fdt [$stb0 fdt $db]
+set flen [$fdt get flen]
+for {set j 0} {$flen > $j} {incr j} {
+       set fd [$fdt .fd\[$j\]]
+       puts [$fd get -tag]
+       $fd done
+}
+$fdt done
+
+$stb0 req type close db $db
+$stb0 .req delete
+
+$stb0 done
+