Revision 1653
trunk/tests/gtests/test_adstring.cpp (revision 1653)  

1  1 
#include <gtest/gtest.h> 
2 
//#include <fvar.hpp> 

3  2 
#include <adstring.hpp> 
4  3  
5  4 
class test_adstring: public ::testing::Test {}; 
...  ...  
156  155 
EXPECT_EQ('a', b(2)); 
157  156 
EXPECT_EQ('d', b(3)); 
158  157 
} 
158 
TEST_F(test_adstring, operator_substring) 

159 
{ 

160 
adstring a; 

161 
a = "1234adcd"; 

162  
163 
adstring b; 

164 
b = a(3, 6); 

165  
166 
EXPECT_EQ(false, a == b); 

167 
EXPECT_EQ(true, b == adstring("34ad")); 

168 
EXPECT_EQ(4, length(b)); 

169 
} 

170 
TEST_F(test_adstring, operator_equalequal) 

171 
{ 

172 
adstring a; 

173 
a = "1234adcd"; 

174  
175 
adstring b; 

176 
b = "4ad"; 

177  
178 
adstring c; 

179 
c = a; 

180  
181 
EXPECT_EQ(true, a == a); 

182 
EXPECT_EQ(false, a == b); 

183 
EXPECT_EQ(true, a == c); 

184 
} 

185 
TEST_F(test_adstring, operator_notequal) 

186 
{ 

187 
adstring a; 

188 
a = "1234adcd"; 

189  
190 
adstring b; 

191 
b = "4ad"; 

192  
193 
adstring c; 

194 
c = a; 

195  
196 
EXPECT_EQ(false, a != a); 

197 
EXPECT_EQ(true, a != b); 

198 
EXPECT_EQ(false, a != c); 

199 
} 
Also available in: Unified diff