]> sourceware.org Git - libabigail.git/commitdiff
Do not filter out diff nodes that are only in NOT_REDUNDANT_CATEGORY
authorDodji Seketeli <dodji@redhat.com>
Tue, 2 Sep 2014 22:13:46 +0000 (00:13 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 3 Sep 2014 07:59:03 +0000 (09:59 +0200)
* src/abg-comparison.cc (diff::is_filtered_out): If a diff not is
only in the NOT_REDUNDANT_CATEGORY category consider it as not
being filtered.
* tests/data/test-diff-filter/test18-report.txt: New test input.
* tests/data/test-diff-filter/test18-v0.cc: Source code for new
test input.
* tests/data/test-diff-filter/test18-v0.o: New test input.
* tests/data/test-diff-filter/test18-v1.cc: Source code for new
test input.
* tests/data/test-diff-filter/test18-v1.o: New test input.
* tests/Makefile.am: Add the new test inputs to the source distribution.
* tests/test-diff-filter.cc: Run this test harness on the new test
input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-comparison.cc
tests/Makefile.am
tests/data/test-diff-filter/test18-report.txt [new file with mode: 0644]
tests/data/test-diff-filter/test18-v0.cc [new file with mode: 0644]
tests/data/test-diff-filter/test18-v0.o [new file with mode: 0644]
tests/data/test-diff-filter/test18-v1.cc [new file with mode: 0644]
tests/data/test-diff-filter/test18-v1.o [new file with mode: 0644]
tests/test-diff-filter.cc

index 3b9ab7fb4f33e6b2c3ee60e306266da8f0f6a2e0..b3a0de4e84624a85e0b20c534485848285c939f1 100644 (file)
@@ -793,6 +793,13 @@ diff::is_filtered_out() const
   if (context()->get_allowed_category() == EVERYTHING_CATEGORY)
     return false;
 
+  // If the diff node is only in the NOT_REDUNDANT_CATEGORY, that
+  // means it represents a change that is not yet categorized and that
+  // the diff not is not redundant.  We definitely want to see that
+  // diff node be reported.
+  if (get_category() == NOT_REDUNDANT_CATEGORY)
+    return false;
+
   // We don't want to display redundant function or variable diff
   // nodes.
   if ((dynamic_cast<const function_decl_diff*>(this)
index fcdb93f3ecee53edaab128297a923849ee4204c3..7a5220ec7d72fa0f2713d6f76a58c69f4a2cbbf9 100644 (file)
@@ -312,6 +312,11 @@ data/test-diff-filter/test17-v0.o          \
 data/test-diff-filter/test17-v1.o              \
 data/test-diff-filter/test17-0-report.txt      \
 data/test-diff-filter/test17-1-report.txt      \
+data/test-diff-filter/test18-v0.cc             \
+data/test-diff-filter/test18-v1.cc             \
+data/test-diff-filter/test18-v0.o              \
+data/test-diff-filter/test18-v1.o              \
+data/test-diff-filter/test18-report.txt                \
 \
 data/test-lookup-syms/test0.cc                 \
 data/test-lookup-syms/test0.o                  \
diff --git a/tests/data/test-diff-filter/test18-report.txt b/tests/data/test-diff-filter/test18-report.txt
new file mode 100644 (file)
index 0000000..811c904
--- /dev/null
@@ -0,0 +1,13 @@
+Functions changes summary: 0 Removed, 1 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+1 function with some indirect sub-type change:
+
+  [C]'function void foo(S&)' has some indirect sub-type changes:
+    parameter 0 of type 'S&' has sub-type changes:
+      in referenced type 'struct S':
+        1 data member change:
+         type of 'int S::m0' changed:
+           name changed from 'int' to 'unsigned int'
+
+
diff --git a/tests/data/test-diff-filter/test18-v0.cc b/tests/data/test-diff-filter/test18-v0.cc
new file mode 100644 (file)
index 0000000..35ef152
--- /dev/null
@@ -0,0 +1,9 @@
+struct S
+{
+  int m0;
+  char m1;
+};
+
+void
+foo(S&)
+{}
diff --git a/tests/data/test-diff-filter/test18-v0.o b/tests/data/test-diff-filter/test18-v0.o
new file mode 100644 (file)
index 0000000..deb4665
Binary files /dev/null and b/tests/data/test-diff-filter/test18-v0.o differ
diff --git a/tests/data/test-diff-filter/test18-v1.cc b/tests/data/test-diff-filter/test18-v1.cc
new file mode 100644 (file)
index 0000000..9f4f8df
--- /dev/null
@@ -0,0 +1,9 @@
+struct S
+{
+  unsigned m0;
+  char m1;
+};
+
+void
+foo(S&)
+{}
diff --git a/tests/data/test-diff-filter/test18-v1.o b/tests/data/test-diff-filter/test18-v1.o
new file mode 100644 (file)
index 0000000..8583b09
Binary files /dev/null and b/tests/data/test-diff-filter/test18-v1.o differ
index 29b561887e9a947bd21671d3fb079a3b099d0252..c360a0b3fc793489d85ca58419ab379020c48788 100644 (file)
@@ -208,6 +208,13 @@ InOutSpec in_out_specs[] =
     "data/test-diff-filter/test17-1-report.txt",
     "output/test-diff-filter/test17-1-report.txt",
   },
+  {
+    "data/test-diff-filter/test18-v0.o",
+    "data/test-diff-filter/test18-v1.o",
+    "",
+    "data/test-diff-filter/test18-report.txt",
+    "output/test-diff-filter/test18-report.txt",
+  },
   // This should be the last entry
   {NULL, NULL, NULL, NULL, NULL}
 };
This page took 0.050528 seconds and 5 git commands to generate.