OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
HashNameGeneratorTest.cpp
Go to the documentation of this file.
2 #include "gtest/gtest.h"
3 #include <fstream>
4 
5 namespace {
6 
7  // The fixture for testing class Foo.
8  class HashNameGeneratorTest : public ::testing::Test {
9  protected:
10 
11  HashNameGeneratorTest() {
12  // You can do set-up work for each test here.
13  }
14 
15  virtual ~HashNameGeneratorTest() {
16  // You can do clean-up work that doesn't throw exceptions here.
17  }
18 
19  // If the constructor and destructor are not enough for setting up
20  // and cleaning up each test, you can define the following methods:
21 
22  virtual void SetUp() {
23  // Code here will be called immediately after the constructor (right
24  // before each test).
25  }
26 
27  virtual void TearDown() {
28  // Code here will be called immediately after each test (right
29  // before the destructor).
30  }
31  };
32 
33  TEST_F(HashNameGeneratorTest, HashName) {
34 
35  std::vector<std::string> params;
36  params.push_back("transferline");
37  params.push_back("sigmax=5.05");
38  params.push_back("sigmay=6.05");
39 
40  std::string hash = NativeHashGenerator::generate(params);
41  std::string expected = "88a02dc533c53bc156f54a4fcc54397b";
42  ASSERT_STREQ(expected.c_str(), hash.c_str());
43  }
44 
45 }
46 
47 int main(int argc, char **argv) {
48  ::testing::InitGoogleTest(&argc, argv);
49  return RUN_ALL_TESTS();
50 }
int main(int argc, char *argv[])
Definition: Main.cpp:107
static std::string generate(std::vector< std::string > arguments, size_t world_pid=0)