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

Function platform_specific_tests

test/operations_test.cpp:1645–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1643 // platform_specific_tests ---------------------------------------------------------//
1644
1645 void platform_specific_tests()
1646 {
1647 // Windows only tests
1648 if (platform == "Windows")
1649 {
1650 cout << "Windows specific tests..." << endl;
1651 if (!skip_long_windows_tests)
1652 {
1653 cout << " (may take several seconds)"<< endl;
1654
1655 BOOST_TEST(!fs::exists(fs::path("//share-not")));
1656 BOOST_TEST(!fs::exists(fs::path("//share-not/")));
1657 BOOST_TEST(!fs::exists(fs::path("//share-not/foo")));
1658 }
1659 cout << endl;
1660
1661 BOOST_TEST(!fs::exists("tools/jam/src/:sys:stat.h")); // !exists() if ERROR_INVALID_NAME
1662 BOOST_TEST(!fs::exists(":sys:stat.h")); // !exists() if ERROR_INVALID_PARAMETER
1663 BOOST_TEST(dir.string().size() > 1
1664 && dir.string()[1] == ':'); // verify path includes drive
1665
1666 BOOST_TEST(fs::system_complete("").empty());
1667 BOOST_TEST(fs::system_complete("/") == fs::initial_path().root_path());
1668 BOOST_TEST(fs::system_complete("foo")
1669 == fs::initial_path() / "foo");
1670
1671 fs::path p1(fs::system_complete("/foo"));
1672 BOOST_TEST_EQ(p1.string().size(), 6U); // this failed during v3 development due to bug
1673 std::string s1(p1.string() );
1674 std::string s2(fs::initial_path().root_path().string()+"foo");
1675 BOOST_TEST_EQ(s1, s2);
1676
1677 BOOST_TEST(fs::system_complete(fs::path(fs::initial_path().root_name()))
1678 == fs::initial_path());
1679 BOOST_TEST(fs::system_complete(fs::path(fs::initial_path().root_name().string()
1680 + "foo")).string() == fs::initial_path() / "foo");
1681 BOOST_TEST(fs::system_complete(fs::path("c:/")).generic_string()
1682 == "c:/");
1683 BOOST_TEST(fs::system_complete(fs::path("c:/foo")).generic_string()
1684 == "c:/foo");
1685 BOOST_TEST(fs::system_complete(fs::path("//share")).generic_string()
1686 == "//share");
1687 } // Windows
1688
1689 else if (platform == "POSIX")
1690 {
1691 cout << "POSIX specific tests..." << endl;
1692 BOOST_TEST(fs::system_complete("").empty());
1693 BOOST_TEST(fs::initial_path().root_path().string() == "/");
1694 BOOST_TEST(fs::system_complete("/").string() == "/");
1695 BOOST_TEST(fs::system_complete("foo").string()
1696 == fs::initial_path().string()+"/foo");
1697 BOOST_TEST(fs::system_complete("/foo").string()
1698 == fs::initial_path().root_path().string()+"foo");
1699 } // POSIX
1700 }
1701
1702 // initial_tests -------------------------------------------------------------------//

Callers 1

cpp_mainFunction · 0.85

Calls 7

existsFunction · 0.85
root_pathMethod · 0.80
root_nameMethod · 0.80
generic_stringMethod · 0.80
pathFunction · 0.70
system_completeFunction · 0.50
initial_pathFunction · 0.50

Tested by

no test coverage detected