1
# Regina - A Normal Surface Theory Calculator
2
# Python Test Suite Component
4
# Copyright (c) 2011, Ben Burton
5
# For further details contact Ben Burton (bab@debian.org).
7
# Tests support for the old binary file format
9
# This file is a single component of Regina's python test suite. To run
10
# the python test suite, move to the main python directory in the source
11
# tree and run "make check".
13
# This program is free software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License as
15
# published by the Free Software Foundation; either version 2 of the
16
# License, or (at your option) any later version.
18
# This program is distributed in the hope that it will be useful, but
19
# WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
# General Public License for more details.
23
# You should have received a copy of the GNU General Public
24
# License along with this program; if not, write to the Free
25
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
29
# Fetch the python/testsuite path in the source tree, since we will need
30
# to access external files.
32
if (len(sys.argv) > 1):
33
testpath = sys.argv[1]
37
# A routine that performs essentially the same tasks as regfiledump.
40
print 'ERROR: Null packet tree.'
45
print '************************************************************'
47
print '* Label: ' + p.getPacketLabel()
48
print '* Type: ' + p.getPacketTypeName()
49
if p.getTreeParent() == None:
50
print '* Parent: (none)'
52
print '* Parent: ' + p.getTreeParent().getPacketLabel()
54
print '************************************************************'
56
print p.toStringLong()
59
p = p.nextTreePacket()
61
# Load and dump some files created by very old versions of regina.
62
dump(regina.readFileMagic(testpath + '/legacyfile1.rga'))
63
dump(regina.readFileMagic(testpath + '/legacyfile2.rga'))