mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-16 15:04:46 +00:00
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:
parent
33be9938be
commit
847c9e8166
@ -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();
|
||||
|
@ -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
|
||||
|
16
tests/data/test-diff-filter/test1-report.txt
Normal file
16
tests/data/test-diff-filter/test1-report.txt
Normal 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)
|
||||
|
||||
|
26
tests/data/test-diff-filter/test1-v0.cc
Normal file
26
tests/data/test-diff-filter/test1-v0.cc
Normal 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*)
|
||||
{}
|
BIN
tests/data/test-diff-filter/test1-v0.o
Normal file
BIN
tests/data/test-diff-filter/test1-v0.o
Normal file
Binary file not shown.
28
tests/data/test-diff-filter/test1-v1.cc
Normal file
28
tests/data/test-diff-filter/test1-v1.cc
Normal 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*)
|
||||
{}
|
BIN
tests/data/test-diff-filter/test1-v1.o
Normal file
BIN
tests/data/test-diff-filter/test1-v1.o
Normal file
Binary file not shown.
@ -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}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user