inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2 )
{
    // NOTE: cannot use operator== here because array layout may "change" for
    // rank-1 views
    BOOST_TEST( v1.data() == v2.data() );
    BOOST_TEST( v1.span() == v2.span() );

    BOOST_TEST( (int)View1::rank == (int)View2::rank );
    BOOST_TEST( ( std::is_same<typename View1::const_value_type,
                               typename View2::const_value_type>::value ) );
    BOOST_TEST( ( std::is_same<typename View1::memory_space,
                               typename View2::memory_space>::value ) );

    BOOST_TEST( v1.dimension_0() == v2.dimension_0() );
    BOOST_TEST( v1.dimension_1() == v2.dimension_1() );
    BOOST_TEST( v1.dimension_2() == v2.dimension_2() );
    BOOST_TEST( v1.dimension_3() == v2.dimension_3() );
    BOOST_TEST( v1.dimension_4() == v2.dimension_4() );
    BOOST_TEST( v1.dimension_5() == v2.dimension_5() );
    BOOST_TEST( v1.dimension_6() == v2.dimension_6() );
    BOOST_TEST( v1.dimension_7() == v2.dimension_7() );
}
inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2,
                                      bool &success,
                                      Teuchos::FancyOStream &out )
{
    // NOTE: cannot use operator== here because array layout may "change" for
    // rank-1 views
    TEST_EQUALITY( v1.data(), v2.data() );
    TEST_EQUALITY( v1.span(), v2.span() );

    TEST_EQUALITY( (int)View1::rank, (int)View2::rank );
    TEST_ASSERT( ( std::is_same<typename View1::const_value_type,
                                typename View2::const_value_type>::value ) );
    TEST_ASSERT( ( std::is_same<typename View1::memory_space,
                                typename View2::memory_space>::value ) );

    TEST_EQUALITY( v1.dimension_0(), v2.dimension_0() );
    TEST_EQUALITY( v1.dimension_1(), v2.dimension_1() );
    TEST_EQUALITY( v1.dimension_2(), v2.dimension_2() );
    TEST_EQUALITY( v1.dimension_3(), v2.dimension_3() );
    TEST_EQUALITY( v1.dimension_4(), v2.dimension_4() );
    TEST_EQUALITY( v1.dimension_5(), v2.dimension_5() );
    TEST_EQUALITY( v1.dimension_6(), v2.dimension_6() );
    TEST_EQUALITY( v1.dimension_7(), v2.dimension_7() );
}