Skip to content

Commit cb08c19

Browse files
Fix utils unit tests
1 parent cf2891f commit cb08c19

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/utils_test.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ TEST(UtilsTestsGroup, formatted_string_stream_test)
5252
CHECK_EQUAL(i1,2);
5353
CHECK_TRUE(std::abs(d1-0.2)<0.00001);
5454
CHECK_EQUAL(i2,1);
55-
CHECK_EQUAL(s1,"SG");
55+
CHECK_TRUE(s1 == "SG");
5656
}
5757

5858
TEST(UtilsTestsGroup, get_tokens_test)
5959
{
60-
CHECK_EQUAL(get_tokens("id,prop,target,spf,name", ','), std::vector<string>({"id","prop","target","spf","name"}));
61-
CHECK_EQUAL(get_tokens("id;prop;target;spf;name", ';'), std::vector<string>({"id","prop","target","spf","name"}));
60+
std::vector<std::string> v1 = { "id","prop","target","spf","name" };
61+
CHECK_TRUE( get_tokens("id,prop,target,spf,name", ',') == v1 );
62+
CHECK_TRUE( get_tokens("id;prop;target;spf;name", ';') == v1 );
6263
}
6364

6465

utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace marxan {
106106

107107
formatted_string_stream& operator>>(std::string& s)
108108
{
109-
if(pos_ >= s.size())
109+
if(pos_ >= s_.size())
110110
{
111111
fail_ = true;
112112
return *this;

0 commit comments

Comments
 (0)