Browse Source

Fix of test for different standard library

master
Artyom Beilis 8 years ago
parent
commit
6300ee06ca
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      tests/response_test.cpp

+ 11
- 1
tests/response_test.cpp View File

@@ -52,7 +52,17 @@ void compare_strings(std::string const &l,std::string const &r,int file_line)

}

std::string remove_brakets(std::string const &in)
{
std::string r;
for(size_t i=0;i<in.size();i++)
if(in[i]!='[' && in[i]!=']')
r+= in[i];
return r;
}

#define TEQ(l,r) compare_strings(l,r,__LINE__)
#define TEQC(l,r) compare_strings(remove_brakets(l),remove_brakets(r),__LINE__)

class test_app : public cppcms::application {
public:
@@ -107,7 +117,7 @@ public:
response().out() << "x";
TEQ(str(),"[x]");
response().out() << 123;
TEQ(str(),"[123]");
TEQC(str(),"[123]");
response().setbuf(4);
response().out() << "abcdefg";
TEQ(str(),"[abcdefg]");


Loading…
Cancel
Save