Skip to content

Commit

Permalink
use more fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Jan 4, 2021
1 parent e653133 commit 59977de
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
23 changes: 17 additions & 6 deletions src/tests/blueprint/t_blueprint_mesh_relay.cpp
Expand Up @@ -13,6 +13,8 @@
#include "conduit_relay.hpp"
#include "conduit_log.hpp"

#include "conduit_fmt/conduit_fmt.h"

#include <math.h>
#include <iostream>
#include "gtest/gtest.h"
Expand Down Expand Up @@ -83,12 +85,21 @@ TEST(conduit_blueprint_mesh_relay, spiral_multi_file)
// domain_
fprefix = "domain_";
}
snprintf(fmt_buff, sizeof(fmt_buff), "%06d",i);
oss.str("");
oss << join_file_path(output_base + ".cycle_000000",
fprefix)
<< fmt_buff << ".hdf5";
std::string fcheck = oss.str();

// std::string fcheck = conduit_fmt::format("{}.cycle_000000");

// snprintf(fmt_buff, sizeof(fmt_buff), "%06d",i);
// oss.str("");
// oss << join_file_path(output_base + ".cycle_000000",
// fprefix)
// << fmt_buff << ".hdf5";
// std::string fcheck = oss.str();

std::string fcheck = conduit_fmt::format("{}{:06d}.hdf5",
join_file_path(output_base + ".cycle_000000",
fprefix),
i);

std::cout << " checking: " << fcheck << std::endl;
EXPECT_TRUE(is_file(fcheck));
}
Expand Down
22 changes: 16 additions & 6 deletions src/tests/blueprint/t_blueprint_mpi_mesh_relay.cpp
Expand Up @@ -16,6 +16,7 @@
#include "conduit_relay_mpi_io.hpp"
#include "conduit_relay_mpi_io_blueprint.hpp"
#include "conduit_utils.hpp"
#include "conduit_fmt/conduit_fmt.h"

#include <mpi.h>
#include <iostream>
Expand Down Expand Up @@ -445,12 +446,21 @@ TEST(blueprint_mpi_relay, spiral_multi_file)
// domain_
fprefix = "domain_";
}
snprintf(fmt_buff, sizeof(fmt_buff), "%06d",i);
oss.str("");
oss << conduit::utils::join_file_path(output_base + ".cycle_000000",
fprefix)
<< fmt_buff << ".hdf5";
std::string fcheck = oss.str();

// snprintf(fmt_buff, sizeof(fmt_buff), "%06d",i);
// oss.str("");
// oss << conduit::utils::join_file_path(output_base + ".cycle_000000",
// fprefix)
// << fmt_buff << ".hdf5";
//
// std::string fcheck = oss.str();

std::string fcheck = conduit_fmt::format("{}{:06d}.hdf5",
join_file_path(output_base + ".cycle_000000",
fprefix),
i);

// std::string fcheck = oss.str();
std::cout << " checking: " << fcheck << std::endl;
EXPECT_TRUE(conduit::utils::is_file(fcheck));
}
Expand Down

0 comments on commit 59977de

Please sign in to comment.