diff --git a/testApp/misc/testSharedVector.cpp b/testApp/misc/testSharedVector.cpp index d12ce85..36dfa86 100644 --- a/testApp/misc/testSharedVector.cpp +++ b/testApp/misc/testSharedVector.cpp @@ -556,6 +556,63 @@ static void testICE() } } +static +void testBad() +{ + epics::pvData::shared_vector I; + epics::pvData::shared_vector CI; + epics::pvData::shared_vector F; + epics::pvData::shared_vector CF; + epics::pvData::shared_vector V; + epics::pvData::shared_vector CV; + (void)I; + (void)CI; + (void)F; + (void)CF; + (void)V; + (void)CV; + + // Tests which should result in compile failure. + // as there is no established way to test this automatically, + // uncomment one at a time + + // No copy from const to non-const + //CI = I; + //I = CI; + //epics::pvData::shared_vector CI2(I); + //epics::pvData::shared_vector I2(CI); + + // shared_vector_convert can't thaw() + //I = epics::pvData::shared_vector_convert(CI); + //V = epics::pvData::shared_vector_convert(CV); + + // shared_vector_convert can't freeze() + //CI = epics::pvData::shared_vector_convert(I); + //CV = epics::pvData::shared_vector_convert(V); + + // static_shared_vector_cast can't thaw() + //I = epics::pvData::static_shared_vector_cast(CI); + //V = epics::pvData::static_shared_vector_cast(CV); + + // static_shared_vector_cast can't freeze() + //CI = epics::pvData::static_shared_vector_cast(I); + //CV = epics::pvData::static_shared_vector_cast(V); + + // freeze() can't change type. + // the error here will be with the assignment + //I = epics::pvData::freeze(CV); + //I = epics::pvData::freeze(CF); + //CI = epics::pvData::freeze(V); + //CI = epics::pvData::freeze(F); + + // that() can't change type. + // the error here will be with the assignment + //CI = epics::pvData::thaw(V); + //CI = epics::pvData::thaw(F); + //I = epics::pvData::thaw(CV); + //I = epics::pvData::that(CF); +} + MAIN(testSharedVector) { testPlan(167); @@ -577,5 +634,6 @@ MAIN(testSharedVector) testVectorConvert(); testWeak(); testICE(); + testBad(); return testDone(); }