| 239 | // test_assignments ----------------------------------------------------------------// |
| 240 | |
| 241 | void test_assignments() |
| 242 | { |
| 243 | std::cout << "testing assignments..." << std::endl; |
| 244 | |
| 245 | x = path("yet another path"); // another path |
| 246 | PATH_IS(x, L"yet another path"); |
| 247 | BOOST_TEST_EQ(x.native().size(), 16U); |
| 248 | |
| 249 | x = x; // self-assignment |
| 250 | PATH_IS(x, L"yet another path"); |
| 251 | BOOST_TEST_EQ(x.native().size(), 16U); |
| 252 | |
| 253 | x.assign(l.begin(), l.end()); // iterator range char |
| 254 | PATH_IS(x, L"string"); |
| 255 | |
| 256 | x.assign(wl.begin(), wl.end()); // iterator range wchar_t |
| 257 | PATH_IS(x, L"wstring"); |
| 258 | |
| 259 | x = string("std::string"); // container char |
| 260 | PATH_IS(x, L"std::string"); |
| 261 | |
| 262 | x = wstring(L"std::wstring"); // container wchar_t |
| 263 | PATH_IS(x, L"std::wstring"); |
| 264 | |
| 265 | x = "array char"; // array char |
| 266 | PATH_IS(x, L"array char"); |
| 267 | |
| 268 | x = L"array wchar"; // array wchar_t |
| 269 | PATH_IS(x, L"array wchar"); |
| 270 | |
| 271 | x = s.c_str(); // const char* null terminated |
| 272 | PATH_IS(x, L"string"); |
| 273 | |
| 274 | x = ws.c_str(); // const wchar_t* null terminated |
| 275 | PATH_IS(x, L"wstring"); |
| 276 | } |
| 277 | |
| 278 | // test_move_construction_and_assignment -------------------------------------------// |
| 279 | |