Add selftests for range_contains and insert_into_bit_range_vector
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 9 Apr 2018 19:45:39 +0000 (15:45 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 9 Apr 2018 19:47:12 +0000 (15:47 -0400)
commitd5f4488f09b811b0ca44e687da2acbc286d84d4a
tree077a671661fadfb1f52c9e58b23b841c6378baba
parentb24531ed171b5751a3a64c461728c9ad62092c8a
Add selftests for range_contains and insert_into_bit_range_vector

Add some selftests for these two functions.  To to make it easier to
compare sequences of ranges, add operator== and operator!= to compare
two gdb::array_view, and add operator== in struct range.

gdb/ChangeLog:

* value.c: Include "selftest.h" and "common/array-view.h".
(struct range) <operator ==>: New.
(test_ranges_contain): New.
(check_ranges_vector): New.
(test_insert_into_bit_range_vector): New.
(_initialize_values): Register selftests.
* common/array-view.h (operator==, operator!=): New.
gdb/ChangeLog
gdb/common/array-view.h
gdb/value.c