~ubuntu-branches/ubuntu/utopic/nordugrid-arc/utopic

« back to all changes in this revision

Viewing changes to src/hed/libs/common/test/StringConvTest.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2014-05-01 20:51:02 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140501205102-icy9t3348uxobyx7
Tags: 4.1.0-1
* 4.1.0 Release
* Call dh_autoreconf to support ppc64le (Closes: #744639)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
  CPPUNIT_TEST(TestStringConv);
14
14
  CPPUNIT_TEST(TestURIEncode);
15
15
  CPPUNIT_TEST(TestIntegers);
 
16
  CPPUNIT_TEST(TestJoin);
16
17
  CPPUNIT_TEST_SUITE_END();
17
18
 
18
19
public:
19
20
  void TestStringConv();
20
21
  void TestURIEncode();
21
22
  void TestIntegers();
 
23
  void TestJoin();
22
24
};
23
25
 
24
26
void StringConvTest::TestStringConv() {
101
103
  CPPUNIT_ASSERT_EQUAL(12345,n);
102
104
}
103
105
 
 
106
void StringConvTest::TestJoin() {
 
107
 
 
108
  std::list<std::string> strlist;
 
109
  CPPUNIT_ASSERT(Arc::join(strlist, " ").empty());
 
110
 
 
111
  strlist.push_back("test");
 
112
  CPPUNIT_ASSERT_EQUAL(std::string("test"), Arc::join(strlist, " "));
 
113
 
 
114
  strlist.push_back("again");
 
115
  CPPUNIT_ASSERT_EQUAL(std::string("test again"), Arc::join(strlist, " "));
 
116
 
 
117
  strlist.push_back("twice");
 
118
  CPPUNIT_ASSERT_EQUAL(std::string("test,again,twice"), Arc::join(strlist, ","));
 
119
}
 
120
 
104
121
CPPUNIT_TEST_SUITE_REGISTRATION(StringConvTest);