MCPcopy Create free account
hub / github.com/crownengine/crown / test_filesystem

Function test_filesystem

src/core/unit_tests.cpp:1883–1918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1881}
1882
1883static void test_filesystem()
1884{
1885 memory_globals::init();
1886 guid_globals::init();
1887 {
1888 TempAllocator256 ta;
1889 DynamicString dir(ta);
1890 char buf[GUID_BUF_LEN];
1891
1892 environment::tmp_dir(dir);
1893 dir += "/";
1894 dir += guid::to_string(buf, sizeof(buf), guid::new_guid());
1895
1896 DeleteResult dr = os::delete_directory(dir.c_str());
1897 ENSURE(dr.error == DeleteResult::NO_ENTRY);
1898 }
1899 {
1900 TempAllocator256 ta;
1901 DynamicString dir(ta);
1902 char buf[GUID_BUF_LEN];
1903
1904 environment::tmp_dir(dir);
1905 dir += "/";
1906 dir += guid::to_string(buf, sizeof(buf), guid::new_guid());
1907
1908 os::delete_directory(dir.c_str());
1909 CreateResult cr = os::create_directory(dir.c_str());
1910 ENSURE(cr.error == CreateResult::SUCCESS);
1911 cr = os::create_directory(dir.c_str());
1912 ENSURE(cr.error == CreateResult::ALREADY_EXISTS);
1913 DeleteResult dr = os::delete_directory(dir.c_str());
1914 ENSURE(dr.error == DeleteResult::SUCCESS);
1915 }
1916 guid_globals::shutdown();
1917 memory_globals::shutdown();
1918}
1919
1920static void test_file_monitor()
1921{

Callers

nothing calls this directly

Calls 8

tmp_dirFunction · 0.85
new_guidFunction · 0.85
delete_directoryFunction · 0.85
create_directoryFunction · 0.85
initFunction · 0.70
to_stringFunction · 0.70
shutdownFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected