22 #include "gtest/gtest.h"
27 class MPIHelperTest :
public ::testing::Test {
34 virtual ~MPIHelperTest() {
41 virtual void SetUp() {
46 virtual void TearDown() {
54 TEST_F(MPIHelperTest, ParamSerialization) {
57 params.insert(std::pair<std::string, double>(
"a", 5.5));
58 params.insert(std::pair<std::string, double>(
"b", -15.2));
60 std::ostringstream serialized;
64 deserialize(
const_cast<char*
>(serialized.str().c_str()),
67 EXPECT_EQ(5.5, deserialized_params[
"a"])
68 <<
"first param not serialized properly";
69 EXPECT_EQ(-15.2, deserialized_params[
"b"])
70 <<
"second param not serialized properly";
75 int main(
int argc,
char **argv) {
76 ::testing::InitGoogleTest(&argc, argv);
77 return RUN_ALL_TESTS();
int main(int argc, char **argv)
void serialize(Param_t params, std::ostringstream &os)
serializes params using Boost archive
void deserialize(char *buffer, Param_t ¶ms)
deserializes params using Boost archive
namedVariableCollection_t Param_t