Skip to content

Commit

Permalink
XMLConfigTest: Add RemoveIO test
Browse files Browse the repository at this point in the history
  • Loading branch information
spyridon97 committed Dec 8, 2023
1 parent 940b50f commit 5525115
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions testing/adios2/xml/TestXMLConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,32 @@ TEST_F(XMLConfigTest, OpNoneException)
#endif
}

TEST_F(XMLConfigTest, RemoveIO)
{
const std::string configFile(configDir + std::string(&adios2::PathSeparator, 1) +
"configRemoveIO.xml");

#if ADIOS2_USE_MPI
adios2::ADIOS adios(configFile, MPI_COMM_WORLD);
#else
adios2::ADIOS adios(configFile);
#endif

adios2::IO io;
adios2::Engine engine;

std::string io_name_ = "checkpoint";
for (int c = 0; c < 3; c++)
{
io = adios.DeclareIO(io_name_);
std::string filename = "test.bp";
engine = io.Open(filename, adios2::Mode::Write);
EXPECT_TRUE(io.EngineType() == "BP4");
engine.Close();
adios.RemoveIO(io_name_);
}
}

int main(int argc, char **argv)
{
#if ADIOS2_USE_MPI
Expand Down
8 changes: 8 additions & 0 deletions testing/adios2/xml/configRemoveIO.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<adios-config>
<io name="checkpoint">
<engine type="BP4">
<parameter key="SubStreams" value="16"/>
</engine>
</io>
</adios-config>

0 comments on commit 5525115

Please sign in to comment.