gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Print the failed line numbers in the unifier script (ticket #138)
0 4 0
default
4 files changed with 19 insertions and 9 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -42,25 +42,25 @@
42 42
    ///The type of the digraph the algorithm runs on.
43 43
    typedef GR Digraph;
44 44

	
45 45
    ///\brief The type of the map that stores the predecessor
46 46
    ///arcs of the shortest paths.
47 47
    ///
48 48
    ///The type of the map that stores the predecessor
49 49
    ///arcs of the shortest paths.
50 50
    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
51 51
    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
52 52
    ///Instantiates a PredMap.
53 53

	
54
    ///This function instantiates a PredMap.
54
    ///This function instantiates a PredMap.  
55 55
    ///\param g is the digraph, to which we would like to define the
56 56
    ///PredMap.
57 57
    static PredMap *createPredMap(const Digraph &g)
58 58
    {
59 59
      return new PredMap(g);
60 60
    }
61 61

	
62 62
    ///The type of the map that indicates which nodes are processed.
63 63

	
64 64
    ///The type of the map that indicates which nodes are processed.
65 65
    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
66 66
    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
... ...
@@ -71,26 +71,25 @@
71 71
    ///we would like to define the ProcessedMap
72 72
#ifdef DOXYGEN
73 73
    static ProcessedMap *createProcessedMap(const Digraph &g)
74 74
#else
75 75
    static ProcessedMap *createProcessedMap(const Digraph &)
76 76
#endif
77 77
    {
78 78
      return new ProcessedMap();
79 79
    }
80 80

	
81 81
    ///The type of the map that indicates which nodes are reached.
82 82

	
83
    ///The type of the map that indicates which nodes are reached.
84
    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
83
    ///The type of the map that indicates which nodes are reached.///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
85 84
    typedef typename Digraph::template NodeMap<bool> ReachedMap;
86 85
    ///Instantiates a ReachedMap.
87 86

	
88 87
    ///This function instantiates a ReachedMap.
89 88
    ///\param g is the digraph, to which
90 89
    ///we would like to define the ReachedMap.
91 90
    static ReachedMap *createReachedMap(const Digraph &g)
92 91
    {
93 92
      return new ReachedMap(g);
94 93
    }
95 94

	
96 95
    ///The type of the map that stores the distances of the nodes.
Ignore white space 6 line context
... ...
@@ -831,26 +831,26 @@
831 831
      bool operator!=(const Edge& edge) const {return id != edge.id;}
832 832
      bool operator<(const Edge& edge) const {return id < edge.id;}
833 833
    };
834 834

	
835 835
    class Arc {
836 836
      friend class ListGraphBase;
837 837
    protected:
838 838

	
839 839
      int id;
840 840
      explicit Arc(int pid) { id = pid;}
841 841

	
842 842
    public:
843
      operator Edge() const { 
844
        return id != -1 ? edgeFromId(id / 2) : INVALID; 
843
      operator Edge() const {
844
        return id != -1 ? edgeFromId(id / 2) : INVALID;
845 845
      }
846 846

	
847 847
      Arc() {}
848 848
      Arc (Invalid) { id = -1; }
849 849
      bool operator==(const Arc& arc) const {return id == arc.id;}
850 850
      bool operator!=(const Arc& arc) const {return id != arc.id;}
851 851
      bool operator<(const Arc& arc) const {return id < arc.id;}
852 852
    };
853 853

	
854 854

	
855 855

	
856 856
    ListGraphBase()
Ignore white space 6 line context
... ...
@@ -455,26 +455,26 @@
455 455
      bool operator!=(const Edge& arc) const {return _id != arc._id;}
456 456
      bool operator<(const Edge& arc) const {return _id < arc._id;}
457 457
    };
458 458

	
459 459
    class Arc {
460 460
      friend class SmartGraphBase;
461 461
    protected:
462 462

	
463 463
      int _id;
464 464
      explicit Arc(int id) { _id = id;}
465 465

	
466 466
    public:
467
      operator Edge() const { 
468
        return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
467
      operator Edge() const {
468
        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
469 469
      }
470 470

	
471 471
      Arc() {}
472 472
      Arc (Invalid) { _id = -1; }
473 473
      bool operator==(const Arc& arc) const {return _id == arc._id;}
474 474
      bool operator!=(const Arc& arc) const {return _id != arc._id;}
475 475
      bool operator<(const Arc& arc) const {return _id < arc._id;}
476 476
    };
477 477

	
478 478

	
479 479

	
480 480
    SmartGraphBase()
Ignore white space 24 line context
... ...
@@ -79,31 +79,42 @@
79 79
    then
80 80
	((++CHANGED_FILES))
81 81
    fi
82 82
    if [ $WARNED == YES ]
83 83
    then
84 84
	((++WARNED_FILES))
85 85
    fi
86 86
}
87 87

	
88 88
function check_action() {
89 89
    if ! diff -q $1 $2 >/dev/null
90 90
    then
91
	echo -n " [$3 failed]"
91
	echo
92
	echo -n "      $3 failed at line(s): "
93
	echo -n $(diff $1 $2 | grep '^[0-9]' | sed "s/^\(.*\)c.*$/ \1/g" | 
94
	          sed "s/,/-/g" | paste -s -d',')
92 95
	FAILED=YES
93 96
    fi
94 97
}
95 98

	
96 99
function check_warning() {
97
    echo -n " [$2 warning]"
100
    echo
101
    if [ "$2" == 'long lines' ]
102
    then
103
        echo -n "      $2 warning at line(s): "
104
        echo -n $(grep -n -E '.{81,}' $1 | sed "s/^\([0-9]*\)/ \1\t/g" | 
105
                  cut -f 1 | paste -s -d',')
106
    else
107
        echo -n "      $2 warning"
108
    fi
98 109
    WARNED=YES
99 110
}
100 111

	
101 112
function check_init() {
102 113
    echo Check source files...
103 114
    FAILED_FILES=0
104 115
    WARNED_FILES=0
105 116
    TOTAL_FILES=0
106 117
}
107 118

	
108 119
function check_done() {
109 120
    echo $FAILED_FILES out of $TOTAL_FILES files has been failed.
0 comments (0 inline)