Tk Library Source Code

View Ticket
Login
Ticket UUID: 720933
Title: testsuite makes incorrect assumptions about walk order
Type: Bug Version: None
Submitter: mic42 Created on: 2003-04-14 06:30:55
Subsystem: struct :: graph Assigned To: andreas_kupries
Priority: 2 Severity:
Status: Closed Last Modified: 2013-07-04 17:20:03
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
The tests in graph.test assume a particular order while
walking a graph, even if multiple valid orderings exist.

This isn't a direct problem for tcllibs ::struct::graph
module, but for modules reusing the test suite for
interface checking, like cgraph does.

There are multiple valid walks through the graph for
each test, but the test suite selects an arbitrary one
as the correct solution based on implementation details
of ::struct::graph

The attached pdf file shows the graph layout for the
tests. One can easily see the multiple valid walk pathes.

Solution:
Match with any of the valid walks, not only with a
single one selected arbitrarily.

Some examples from running the tests with another
implementation of the interface (cgraph):



---- Result was:
enter mygraph i enter mygraph ix enter mygraph vii
enter mygraph vi enter mygraph viii enter mygraph ii
enter mygraph iii enter mygraph iv enter mygraph v
---- Result should have been (exact matching):
enter mygraph i enter mygraph ii enter mygraph iii
enter mygraph iv enter mygraph v enter mygraph vi enter
mygraph viii enter mygraph ix enter mygraph vii
==== graph-21.10 FAILED


==== graph-21.11 forward post-order dfs walk FAILED
---- Result was:
leave mygraph viii leave mygraph vi leave mygraph v
leave mygraph iv leave mygraph iii leave mygraph ii
leave mygraph vii leave mygraph ix leave mygraph i
---- Result should have been (exact matching):
leave mygraph viii leave mygraph vi leave mygraph v
leave mygraph iv leave mygraph iii leave mygraph ii
leave mygraph ix leave mygraph vii leave mygraph i
==== graph-21.11 FAILED
==== graph-21.12 forward both-order dfs walk FAILED
---- Result was:
enter mygraph i enter mygraph ii enter mygraph iii
enter mygraph iv enter mygraph v enter mygraph vi enter
mygraph viii leave mygraph viii leave mygraph vi leave
mygraph v leave mygraph iv leave mygraph iii leave
mygraph ii enter mygraph vii leave mygraph vii enter
mygraph ix leave mygraph ix leave mygraph i
---- Result should have been (exact matching):
enter mygraph i enter mygraph ii enter mygraph iii
enter mygraph iv enter mygraph v enter mygraph vi enter
mygraph viii leave mygraph viii leave mygraph vi leave
mygraph v leave mygraph iv leave mygraph iii leave
mygraph ii enter mygraph ix leave mygraph ix enter
mygraph vii leave mygraph vii leave mygraph i
==== graph-21.12 FAILED
==== graph-21.13 forward pre-order bfs walk FAILED
---- Result was:
enter mygraph i enter mygraph ix enter mygraph ii enter
mygraph iii enter mygraph iv enter mygraph v enter
mygraph vi enter mygraph viii enter mygraph vii
---- Result should have been (exact matching):
enter mygraph i enter mygraph ii enter mygraph ix enter
mygraph vii enter mygraph iii enter mygraph vi enter
mygraph iv enter mygraph viii enter mygraph v
==== graph-21.13 FAILED
==== graph-21.14 backward pre-order bfs walk FAILED
---- Result was:
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph v enter mygraph iv enter
mygraph iii enter mygraph ii enter mygraph vii
---- Result should have been (exact matching):
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph v enter mygraph vii
enter mygraph iv enter mygraph iii enter mygraph ii
==== graph-21.14 FAILED
==== graph-21.15 backward pre-order dfs walk FAILED
---- Result was:
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph vii enter mygraph v
enter mygraph iv enter mygraph iii enter mygraph ii
---- Result should have been (exact matching):
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph v enter mygraph iv enter
mygraph iii enter mygraph ii enter mygraph vii
==== graph-21.15 FAILED
==== graph-21.16 backward post-order dfs walk FAILED
---- Result was:
leave mygraph vii leave mygraph ii leave mygraph iii
leave mygraph iv leave mygraph v leave mygraph vi leave
mygraph viii leave mygraph i leave mygraph ix
---- Result should have been (exact matching):
leave mygraph ii leave mygraph iii leave mygraph iv
leave mygraph v leave mygraph vii leave mygraph vi
leave mygraph viii leave mygraph i leave mygraph ix
==== graph-21.16 FAILED
==== graph-21.17 backward both-order dfs walk FAILED
---- Result was:
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph vii leave mygraph vii
enter mygraph v enter mygraph iv enter mygraph iii
enter mygraph ii leave mygraph ii leave mygraph iii
leave mygraph iv leave mygraph v leave mygraph vi leave
mygraph viii leave mygraph i leave mygraph ix
---- Result should have been (exact matching):
enter mygraph ix enter mygraph i enter mygraph viii
enter mygraph vi enter mygraph v enter mygraph iv enter
mygraph iii enter mygraph ii leave mygraph ii leave
mygraph iii leave mygraph iv leave mygraph v enter
mygraph vii leave mygraph vii leave mygraph vi leave
mygraph viii leave mygraph i leave mygraph ix
==== graph-21.17 FAILED
User Comments: mic42 added on 2003-04-14 13:30:55:

File Added - 47681: testgraph.pdf

Attachments: