Skip to content

Commit

Permalink
operator plugin example: return error state for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
caitlinross committed Feb 21, 2023
1 parent 15b9152 commit e1c1075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/plugins/operator/examplePluginOperator_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int main(int argc, char *argv[])
0.0001,
};

bool success = false;
try
{
/** ADIOS class factory of IO class objects */
Expand Down Expand Up @@ -85,6 +86,7 @@ int main(int argc, char *argv[])

/** Engine becomes unreachable after this*/
reader.Close();
success = true;
}
catch (std::invalid_argument &e)
{
Expand All @@ -102,5 +104,5 @@ int main(int argc, char *argv[])
std::cout << e.what() << "\n";
}

return 0;
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}
4 changes: 3 additions & 1 deletion examples/plugins/operator/examplePluginOperator_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int main(int argc, char *argv[])
};
const std::size_t Nx = myDoubles.size();

bool success = false;
try
{
/** ADIOS class factory of IO class objects */
Expand Down Expand Up @@ -73,6 +74,7 @@ int main(int argc, char *argv[])

/** Engine becomes unreachable after this*/
writer.Close();
success = true;
}
catch (std::invalid_argument &e)
{
Expand All @@ -90,5 +92,5 @@ int main(int argc, char *argv[])
std::cout << e.what() << "\n";
}

return 0;
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit e1c1075

Please sign in to comment.