diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2016-11-24 17:48:04 +0100 |
---|---|---|
committer | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2016-11-24 17:48:04 +0100 |
commit | ad06383f106ccfa299a6c7ac9720178d2d3d583f (patch) | |
tree | a621945f9fecaf62b101615ba0d1689abc65e602 /gdb/selftest.c | |
parent | 22347e554cd7ba2a0bf36dc81ebfcbe2e2fd74af (diff) | |
download | gdb-ad06383f106ccfa299a6c7ac9720178d2d3d583f.zip gdb-ad06383f106ccfa299a6c7ac9720178d2d3d583f.tar.gz gdb-ad06383f106ccfa299a6c7ac9720178d2d3d583f.tar.bz2 |
Add unit test for copy_bitwise
This adds a unit test for the copy_bitwise function in dwarf2loc.c.
With the old (broken) version of copy_bitwise this test would generate
the following failure message:
(gdb) maintenance selftest
Self test failed: copy_bitwise 11000000 != 10000000 (7+2 -> 0)
gdb/ChangeLog:
2016-11-24 Andreas Arnez <arnez@linux.vnet.ibm.com>
Pedro Alves <palves@redhat.com>
* dwarf2loc.c (bits_to_str, check_copy_bitwise)
(copy_bitwise_tests): New functions.
(_initialize_dwarf2loc): Register the new function
copy_bitwise_tests as a unit test.
* selftest.c (run_self_tests): Improve the failure message's
wording and formatting.
Diffstat (limited to 'gdb/selftest.c')
-rw-r--r-- | gdb/selftest.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/selftest.c b/gdb/selftest.c index 110b9e5..f771e57 100644 --- a/gdb/selftest.c +++ b/gdb/selftest.c @@ -50,8 +50,7 @@ run_self_tests (void) CATCH (ex, RETURN_MASK_ERROR) { ++failed; - exception_fprintf (gdb_stderr, ex, - _("Self test threw exception")); + exception_fprintf (gdb_stderr, ex, _("Self test failed: ")); } END_CATCH } |