From 85939048b457e4808f2f9b8c29d257d53f24fe61 Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Fri, 18 Mar 2016 16:53:16 -0700 Subject: [PATCH] Test for operator function call. --- tests/span_tests.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp index 01784f6..9afd943 100644 --- a/tests/span_tests.cpp +++ b/tests/span_tests.cpp @@ -732,7 +732,7 @@ SUITE(span_tests) for (int i = 0; i < 4; ++i) CHECK(av2[i] == i + 2); } } -#if 0 + TEST(operator_function_call) { int arr[4] = {1, 2, 3, 4}; @@ -743,15 +743,15 @@ SUITE(span_tests) CHECK_THROW(s(5), fail_fast); } - int arr2d[2][3] = {1, 2, 3, 4, 5, 6}; - { - span s = arr2d; - CHECK(s(0, 0) == 1); - CHECK(s(1, 2) == 6); + int arr2d[2] = {1, 6}; + span s = arr2d; + CHECK(s(0) == 1); + CHECK(s(1) == 6); + CHECK_THROW(s(2) ,fail_fast); } } - +#if 0 TEST(comparison_operators) { { @@ -864,6 +864,8 @@ SUITE(span_tests) } } +#if 0 + TEST(basics) { auto ptr = as_span(new int[10], 10);