MCPcopy Create free account
hub / github.com/boostorg/filesystem / test_assignments

Function test_assignments

test/path_unit_test.cpp:241–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239// test_assignments ----------------------------------------------------------------//
240
241void 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

Callers 1

test_mainFunction · 0.85

Calls 7

stringFunction · 0.85
pathFunction · 0.70
sizeMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected