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

Function cpp_main

test/path_test.cpp:1796–1879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1794//--------------------------------------------------------------------------------------//
1795
1796int cpp_main(int, char*[])
1797{
1798 // The choice of platform is make at runtime rather than compile-time
1799 // so that compile errors for all platforms will be detected even though
1800 // only the current platform is runtime tested.
1801 platform = (platform == "Win32" || platform == "Win64" || platform == "Cygwin")
1802 ? "Windows"
1803 : "POSIX";
1804 std::cout << "Platform is " << platform << '\n';
1805
1806 BOOST_TEST(p1.string() != p3.string());
1807 p3 = p2;
1808 BOOST_TEST(p1.string() == p3.string());
1809
1810 path p4("foobar");
1811 BOOST_TEST(p4.string() == "foobar");
1812 p4 = p4; // self-assignment
1813 BOOST_TEST(p4.string() == "foobar");
1814
1815 construction_tests();
1816 append_tests();
1817 self_assign_and_append_tests();
1818 overload_tests();
1819 query_and_decomposition_tests();
1820 composition_tests();
1821 iterator_tests();
1822 non_member_tests();
1823 exception_tests();
1824 name_function_tests();
1825 replace_extension_tests();
1826 make_preferred_tests();
1827
1828 // verify deprecated names still available
1829
1830# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
1831
1832 p1.branch_path();
1833 p1.leaf();
1834 path p_remove_leaf;
1835 p_remove_leaf.remove_leaf();
1836
1837# endif
1838
1839 std::string s1("//:somestring"); // this used to be treated specially
1840
1841 // check the path member templates
1842 p5.assign(s1.begin(), s1.end());
1843
1844 PATH_TEST_EQ(p5.string(), "//:somestring");
1845 p5 = s1;
1846 PATH_TEST_EQ(p5.string(), "//:somestring");
1847
1848 // this code, courtesy of David Whetstone, detects a now fixed bug that
1849 // derefereced the end iterator (assuming debug build with checked itors)
1850 std::vector<char> v1;
1851 p5.assign(v1.begin(), v1.end());
1852 std::string s2(v1.begin(), v1.end());
1853 PATH_TEST_EQ(p5.string(), s2);

Callers

nothing calls this directly

Calls 15

construction_testsFunction · 0.85
append_testsFunction · 0.85
overload_testsFunction · 0.85
composition_testsFunction · 0.85
iterator_testsFunction · 0.85
non_member_testsFunction · 0.85
name_function_testsFunction · 0.85
replace_extension_testsFunction · 0.85
make_preferred_testsFunction · 0.85
beginMethod · 0.80

Tested by

no test coverage detected