Skip to content

Commit 6240fe6

Browse files
committed
Add regression test, which fails with the old version of deep copy.
1 parent f2e8708 commit 6240fe6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/axom/sidre/tests/sidre_view.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,30 @@ TEST(sidre_view, clear_view)
18281828

18291829
//------------------------------------------------------------------------------
18301830

1831+
TEST(sidre_view, deep_copy_shape)
1832+
{
1833+
DataStore* ds = new DataStore();
1834+
Group* root = ds->getRoot();
1835+
Group* groupA = root->createGroup("groupA");
1836+
Group* groupB = root->createGroup("groupB");
1837+
1838+
{
1839+
const IndexType shapeA[3] = {3, 2, 5};
1840+
View* viewA = groupA->createViewWithShape("array3d", INT_ID, 3, shapeA);
1841+
View* viewB = groupB->deepCopyView(viewA);
1842+
IndexType shapeB[3] = { -1, -1, -1 };
1843+
viewB->getShape(3, shapeB);
1844+
EXPECT_EQ(viewB->getNumDimensions(), 3);
1845+
EXPECT_EQ(shapeB[0], shapeA[0]);
1846+
EXPECT_EQ(shapeB[1], shapeA[1]);
1847+
EXPECT_EQ(shapeB[2], shapeA[2]);
1848+
}
1849+
1850+
delete ds;
1851+
}
1852+
1853+
//------------------------------------------------------------------------------
1854+
18311855
#ifdef AXOM_USE_UMPIRE
18321856

18331857
class UmpireTest : public ::testing::TestWithParam<int>

0 commit comments

Comments
 (0)