[2/3] abidiff: Blank line after declaration-only diff.

Message ID 20200422212059.258602-2-gprocida@google.com
State Committed
Headers
Series [1/3] Add tests for declaration-only struct diffs. |

Commit Message

Giuliano Procida April 22, 2020, 9:20 p.m. UTC
  In the case where a type change is summarised as declaration-only to
defined or vice versa, the trailing new line was missing.

	* src/abg-default-reporter.cc (default_reporter::report): In
	the class_or_union_diff overload, emit a new line at the end
	of the declaration-only reporting path.
	* tests/data/test-abidiff-exit/test-decl-struct-report.txt:
	Add missing blank lines.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-default-reporter.cc                              | 2 +-
 tests/data/test-abidiff-exit/test-decl-struct-report.txt | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Dodji Seketeli April 27, 2020, 11:15 a.m. UTC | #1
Giuliano Procida <gprocida@google.com> a ?crit:

> In the case where a type change is summarised as declaration-only to
> defined or vice versa, the trailing new line was missing.
>
> 	* src/abg-default-reporter.cc (default_reporter::report): In
> 	the class_or_union_diff overload, emit a new line at the end
> 	of the declaration-only reporting path.
> 	* tests/data/test-abidiff-exit/test-decl-struct-report.txt:
> 	Add missing blank lines.

Applied to master, thanks!

Cheers,
  

Patch

diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc
index ff7ed67e..04e2bb76 100644
--- a/src/abg-default-reporter.cc
+++ b/src/abg-default-reporter.cc
@@ -859,7 +859,7 @@  default_reporter::report(const class_or_union_diff& d,
 	  : " and is now a defined type";
 
 	out << indent << "type " << first->get_pretty_representation()
-	    << was << is_now;
+	    << was << is_now << "\n";
 	return;
       }
 
diff --git a/tests/data/test-abidiff-exit/test-decl-struct-report.txt b/tests/data/test-abidiff-exit/test-decl-struct-report.txt
index aa5dedae..8bb712e6 100644
--- a/tests/data/test-abidiff-exit/test-decl-struct-report.txt
+++ b/tests/data/test-abidiff-exit/test-decl-struct-report.txt
@@ -9,9 +9,11 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
         in unqualified underlying type 'struct embodied' at test-decl-struct-v1.c:1:1:
           type size changed from 0 to 32 (in bits)
           type struct embodied was a declaration-only type and is now a defined type
+
   [C] 'function void reg2(const disembodied*)' at test-decl-struct-v1.c:5:1 has some indirect sub-type changes:
     parameter 1 of type 'const disembodied*' has sub-type changes:
       in pointed to type 'const disembodied':
         in unqualified underlying type 'struct disembodied':
           type size changed from 32 to 0 (in bits)
           type struct disembodied was a defined type and is now a declaration-only type
+