~ubuntu-branches/ubuntu/vivid/regina-normal/vivid-proposed

« back to all changes in this revision

Viewing changes to python/testsuite/legacyfile.test

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2011-09-10 07:17:25 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110910071725-97n90tywdq60w2cr
Tags: 4.90-1
* New upstream release!
* The user interface has been ported from KDE3 to KDE4 (closes: #556318).
  Re-enabled the GUI as a result.
* The build system has been ported from autotools to cmake.
* The new upstream release builds fine on amd64 (closes: #624882).
* Moved the users' handbook into regina-normal-doc.
* Upgraded several suggests/recommends.  Upgraded regina-normal-mpi to
  depend on mpi-default-bin, and regina-normal to depend on both graphviz
  and regina-normal-doc (which the GUI expends to be present).  Upgraded
  regina-normal to recommend gap.
* Bumped standards-version to 3.9.2.0 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Regina - A Normal Surface Theory Calculator
 
2
# Python Test Suite Component
 
3
#
 
4
# Copyright (c) 2011, Ben Burton
 
5
# For further details contact Ben Burton (bab@debian.org).
 
6
#
 
7
# Tests support for the old binary file format
 
8
#
 
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".
 
12
#
 
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.
 
17
#
 
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.
 
22
#
 
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,
 
26
# MA 02110-1301, USA.
 
27
 
 
28
 
 
29
# Fetch the python/testsuite path in the source tree, since we will need
 
30
# to access external files.
 
31
import sys
 
32
if (len(sys.argv) > 1):
 
33
        testpath = sys.argv[1]
 
34
else:
 
35
        testpath = '.'
 
36
 
 
37
# A routine that performs essentially the same tasks as regfiledump.
 
38
def dump(tree):
 
39
        if tree == None:
 
40
                print 'ERROR: Null packet tree.'
 
41
                return
 
42
 
 
43
        p = tree
 
44
        while p != None:
 
45
                print '************************************************************'
 
46
                print '*'
 
47
                print '* Label: ' + p.getPacketLabel()
 
48
                print '* Type: ' + p.getPacketTypeName()
 
49
                if p.getTreeParent() == None:
 
50
                        print '* Parent: (none)'
 
51
                else:
 
52
                        print '* Parent: ' + p.getTreeParent().getPacketLabel()
 
53
                print '*'
 
54
                print '************************************************************'
 
55
                print
 
56
                print p.toStringLong()
 
57
                print
 
58
 
 
59
                p = p.nextTreePacket()
 
60
 
 
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'))
 
64