From 4d830ab33c75dc07d77796d422d909c235c2c127 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 6 Sep 2017 10:25:54 +0200 Subject: const correctness in o3tl::array_view Change-Id: I44c1ace97ae44069c5a0c6a247aa8a0b49896ad3 Reviewed-on: https://gerrit.libreoffice.org/41985 Tested-by: Jenkins Reviewed-by: Noel Grandin --- o3tl/qa/test-array_view.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'o3tl') diff --git a/o3tl/qa/test-array_view.cxx b/o3tl/qa/test-array_view.cxx index ab97d7de49c5..b82aa8cd1bf4 100644 --- a/o3tl/qa/test-array_view.cxx +++ b/o3tl/qa/test-array_view.cxx @@ -28,7 +28,7 @@ private: void testOperations() { int const some_data[] { 1, 2, 3 }; - o3tl::array_view v(some_data); + o3tl::array_view v(some_data); CPPUNIT_ASSERT_EQUAL(1, *v.begin()); CPPUNIT_ASSERT_EQUAL( @@ -63,12 +63,18 @@ private: { int const d1[] { 1, 2 }; int const d2[] { 3, 4, 5, 6 }; - o3tl::array_view v1( d1 ); - o3tl::array_view v2( d2 ); + o3tl::array_view v1( d1 ); + o3tl::array_view v2( d2 ); v1.swap(v2); CPPUNIT_ASSERT_EQUAL(o3tl::array_view::size_type(4), v1.size()); CPPUNIT_ASSERT_EQUAL(o3tl::array_view::size_type(2), v2.size()); } + { + int d1[] { 1, 2, 3 }; + o3tl::array_view v1(d1); + o3tl::array_view v2; + v2 = v1; // the special operator= + } } }; -- cgit