Skip to content

Commit

Permalink
Merge pull request #2761 from eisenhauer/ConfigAPI
Browse files Browse the repository at this point in the history
Add const char* entry to ADIOS constructors to avoid ugliness
  • Loading branch information
eisenhauer authored Jun 15, 2021
2 parents fef6758 + 6218b68 commit 4056265
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/CXX11/adios2/cxx11/ADIOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ADIOS::ADIOS(const std::string &configFile, const bool debugMode)
{
}

ADIOS::ADIOS(const char *configFile) : ADIOS(std::string(configFile), "C++") {}

ADIOS::ADIOS(const bool debugMode) : ADIOS("", "C++") {}

ADIOS::ADIOS(const std::string &configFile, const std::string &hostLanguage,
Expand Down
8 changes: 8 additions & 0 deletions bindings/CXX11/adios2/cxx11/ADIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ class ADIOS
*/
ADIOS(const std::string &configFile, const bool debugMode = true);

/**
* Starting point for non-MPI serial apps. Creates an ADIOS object allowing
* a runtime config file.
* @param configFile runtime config file
* @exception std::invalid_argument if user input is incorrect
*/
ADIOS(const char *configFile);

/**
* Starting point for non-MPI apps. Creates an ADIOS object
* @param debugMode is deprecated and has no effect on library behavior
Expand Down
10 changes: 10 additions & 0 deletions testing/adios2/interface/TestADIOSInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ TEST(ADIOSInterface, MPICommRemoved)

#endif

TEST(ADIOSInterface, BADConfigFile)
{
EXPECT_THROW(adios2::ADIOS adios("notthere.xml");
adios2::IO io = adios.DeclareIO("TestIO");

adios2::Engine engine =
io.Open("test.bp", adios2::Mode::Write);
, std::logic_error);
}

/** ADIOS2_CXX11_API
*/
class ADIOS2_CXX11_API : public ::testing::Test
Expand Down

0 comments on commit 4056265

Please sign in to comment.