Fix stray comma in leaf-changes-only mode.
authorGiuliano Procida <gprocida@google.com>
Wed, 5 Feb 2020 11:17:13 +0000 (11:17 +0000)
committerDodji Seketeli <dodji@redhat.com>
Wed, 19 Feb 2020 13:00:23 +0000 (14:00 +0100)
commit272817b253ce59825aec57736f3554529db01ab2
tree8140df20d854778c74f2c5eb8226fe98e8c0ccfa
parent9640ec39acbf19a16e6f92db686096e010161f61
Fix stray comma in leaf-changes-only mode.

This change replaces the "\n," sometimes seen in output (such as for
the PR25128 test cases) with a correctly indented "and".

* src/abg-reporter-priv.cc (represent): Don't try to follow
        output of indented pretty representation with a comma, just
        emit "and" unconditionally; remove unnecessary intermediate
        ostringstream.
* tests/data/Makefile.am: Add new test case files.
* tests/data/test-abidiff-exit/test-no-stray-comma-*: New test
        cases.
        * tests/data/test-diff-suppr/test46-PR25128-report-?.txt:
        Replace unindented comma with indented "and".
* tests/test-abidiff-exit.cc: Add no-stray-comma test case.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Reviewed-by: Matthias Maennich <maennich@google.com>
src/abg-reporter-priv.cc
tests/data/Makefile.am
tests/data/test-abidiff-exit/test-no-stray-comma-report.txt [new file with mode: 0644]
tests/data/test-abidiff-exit/test-no-stray-comma-v0.o [new file with mode: 0644]
tests/data/test-abidiff-exit/test-no-stray-comma-v1.o [new file with mode: 0644]
tests/data/test-diff-suppr/test46-PR25128-report-1.txt
tests/data/test-diff-suppr/test46-PR25128-report-2.txt
tests/test-abidiff-exit.cc