Fix thinko class_diff traversing.

* src/abg-comparison.cc (class_diff::traverse): Fix thinking in
	introduced by commit "6709478 Fix infinite loop when traversing
	classes and their members"
	* tests/data/test-diff-filter/test1-v{0,1}.o: New test binary input files.
	* tests/data/test-diff-filter/test1-v{0,1}.cc: Source code for the
	above.
	* tests/data/test-diff-filter/test1-report.txt: Reference report
	for the diffing of the two binary input files above.
	* tests/test-diff-filter.cc: Make the test run on the new input above.
	* tests/Makefile.am: Add the new material to the distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-03-31 13:07:04 +02:00
parent 33be9938be
commit 847c9e8166
8 changed files with 86 additions and 3 deletions

View File

@ -3283,13 +3283,13 @@ class_diff::report(ostream& out, const string& indent) const
bool
class_diff::traverse(diff_node_visitor& v)
{
priv_->traversing_ = true;
TRY_PRE_VISIT_CLASS_DIFF(v);
if (priv_->traversing_)
return true;
priv_->traversing_ = true;
// base class changes.
for (string_changed_base_map::const_iterator i =
priv_->changed_bases_.begin();

View File

@ -134,7 +134,13 @@ data/test-diff-filter/test0-v0.cc \
data/test-diff-filter/test0-v1.cc \
data/test-diff-filter/test0-v0.o \
data/test-diff-filter/test0-v1.o \
data/test-diff-filter/test0-report.txt
data/test-diff-filter/test0-report.txt \
\
data/test-diff-filter/test1-v0.cc \
data/test-diff-filter/test1-v1.cc \
data/test-diff-filter/test1-v0.o \
data/test-diff-filter/test1-v1.o \
data/test-diff-filter/test1-report.txt
clean-local: clean-local-check

View File

@ -0,0 +1,16 @@
Functions changes summary: 0 Removed, 1 Changed (1 filtered out), 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
1 function with some indirect sub-type change:
[C]'function void bar(C1*)' has some indirect sub-type changes:
parameter 0 of type 'C1*' changed:
in pointed to type 'class C1':
size changed from 32 to 64 bits
1 data member change:
'int C1::m1' offset changed from 0 to 32
1 data member insertion:
'char C1::m0', at offset 0 (in bits)

View File

@ -0,0 +1,26 @@
struct C0
{
int m0;
C0()
: m0(0)
{}
};
class C1
{
int m1;
public:
C1()
: m1(0)
{}
};
void
foo(C0&)
{}
void
bar(C1*)
{}

Binary file not shown.

View File

@ -0,0 +1,28 @@
class C0
{
int m0;
public:
C0()
: m0(0)
{}
};
class C1
{
char m0;
int m1;
public:
C1()
: m1(0)
{}
};
void
foo(C0&)
{}
void
bar(C1*)
{}

Binary file not shown.

View File

@ -61,6 +61,13 @@ InOutSpec in_out_specs[] =
"data/test-diff-filter/test0-report.txt",
"output/test-diff-filter/test0-report.txt",
},
{
"data/test-diff-filter/test1-v0.o",
"data/test-diff-filter/test1-v1.o",
"--no-harmless",
"data/test-diff-filter/test1-report.txt",
"output/test-diff-filter/test1-report.txt",
},
// This should be the last entry
{NULL, NULL, NULL, NULL, NULL}
};