aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/unittests')
-rw-r--r--gdb/unittests/array-view-selftests.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/array-view-selftests.c
index 3116ab2..74defa1 100644
--- a/gdb/unittests/array-view-selftests.c
+++ b/gdb/unittests/array-view-selftests.c
@@ -483,6 +483,19 @@ run_tests ()
gdb::array_view<Vec> view_elem = elem;
SELF_CHECK (view_elem.size () == 1);
}
+
+ /* gdb::make_array_view, int length. */
+ {
+ gdb_byte data[] = {0x55, 0x66, 0x77, 0x88};
+ int len = sizeof (data) / sizeof (data[0]);
+ auto view = gdb::make_array_view (data, len);
+
+ SELF_CHECK (view.data () == data);
+ SELF_CHECK (view.size () == len);
+
+ for (size_t i = 0; i < len; i++)
+ SELF_CHECK (view[i] == data[i]);
+ }
}
} /* namespace array_view_tests */