Skip to content

Commit

Permalink
changes requested on review
Browse files Browse the repository at this point in the history
  • Loading branch information
facuMH committed Jul 27, 2022
1 parent 56276cf commit 0d2b16d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace detail {
num_nodes = world_size;

cfg = std::make_unique<config>(argc, argv);
if(is_dry_run()) {
if(cfg->is_dry_run()) {
if(num_nodes != 1) throw std::runtime_error("Cannot perform a dry run with more than one rank.\n");
num_nodes = cfg->get_dry_run_nodes();
CELERITY_WARN("Performing a dry run with {} simulated nodes", num_nodes);
Expand Down
2 changes: 1 addition & 1 deletion test/runtime_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ namespace detail {

TEST_CASE_METHOD(test_utils::runtime_fixture, "Dry run generates commands for an arbitrary number of simulated worker nodes", "[dryrun]") {
const size_t nodes = GENERATE(values({4, 8, 16}));
SECTION("with {} nodes", std::to_string(nodes).c_str()) { dry_run_with_nodes(nodes); }
dry_run_with_nodes(nodes);
}

} // namespace detail
Expand Down
10 changes: 5 additions & 5 deletions test/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ namespace test_utils {
SetEnvironmentVariable(env.c_str(), val.c_str());
env_var_name = env;
}
// if it was not previously set, then original_value is 0. using setEnvVar with 0 deletes the env var.

~set_test_env() {
if(original_value.size()) {
SetEnvironmentVariable(env_var_name.c_str(), original_value.c_str());
} else {
if(original_value.empty()) {
SetEnvironmentVariable(env_var_name.c_str(), NULL);
} else {
SetEnvironmentVariable(env_var_name.c_str(), original_value.c_str());
}
}
#else
Expand All @@ -467,7 +467,7 @@ namespace test_utils {
env_var_name = env;
}
~set_test_env() {
if(!original_value.size()) {
if(original_value.empty()) {
unsetenv(env_var_name.c_str());
} else {
setenv(env_var_name.c_str(), original_value.c_str(), 1);
Expand Down

0 comments on commit 0d2b16d

Please sign in to comment.