MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/fs_tests.cpp:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16BOOST_FIXTURE_TEST_SUITE(fs_tests, BasicTestingSetup)
17
18BOOST_AUTO_TEST_CASE(fsbridge_pathtostring)
19{
20 std::string u8_str = "fs_tests_₿_🏃";
21 BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(u8_str)), u8_str);
22 BOOST_CHECK_EQUAL(fs::u8path(u8_str).u8string(), u8_str);
23 BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).u8string(), u8_str);
24 BOOST_CHECK_EQUAL(fs::PathToString(fs::u8path(u8_str)), u8_str);
25#ifndef WIN32
26 // On non-windows systems, verify that arbitrary byte strings containing
27 // invalid UTF-8 can be round tripped successfully with PathToString and
28 // PathFromString. On non-windows systems, paths are just byte strings so
29 // these functions do not do any encoding. On windows, paths are Unicode,
30 // and these functions do encoding and decoding, so the behavior of this
31 // test would be undefined.
32 std::string invalid_u8_str = "\xf0";
33 BOOST_CHECK_EQUAL(invalid_u8_str.size(), 1);
34 BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(invalid_u8_str)), invalid_u8_str);
35#endif
36}
37
38BOOST_AUTO_TEST_CASE(fsbridge_stem)
39{

Callers

nothing calls this directly

Calls 8

PathToStringFunction · 0.85
PathFromStringFunction · 0.85
AbsPathJoinFunction · 0.85
GetUniquePathFunction · 0.85
RenameOverFunction · 0.85
existsFunction · 0.85
create_directoriesFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected