mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 08:07:17 +07:00
Merge remote-tracking branch 'origin/master' into feature/debug_hierarchy
This commit is contained in:
@@ -33,15 +33,15 @@ TEST_CASE("vfs"){
|
||||
REQUIRE(v.read({"file", nofile_path}) == input_stream_uptr());
|
||||
}
|
||||
{
|
||||
buffer b0;
|
||||
REQUIRE(v.load({"file", file_path}, b0));
|
||||
auto b0 = v.load({"file", file_path});
|
||||
REQUIRE(b0);
|
||||
REQUIRE(b0 == buffer{"hello", 5});
|
||||
|
||||
auto b1 = v.load_async({"file", file_path}).get();
|
||||
REQUIRE(b1 == buffer{"hello", 5});
|
||||
|
||||
str b2;
|
||||
REQUIRE(v.load_as_string({"file", file_path}, b2));
|
||||
auto b2 = v.load_as_string({"file", file_path});
|
||||
REQUIRE(b2);
|
||||
REQUIRE(b2 == "hello");
|
||||
|
||||
auto b3 = v.load_as_string_async({"file", file_path}).get();
|
||||
@@ -135,15 +135,15 @@ TEST_CASE("vfs"){
|
||||
REQUIRE(b == buffer("hello", 5));
|
||||
}
|
||||
{
|
||||
buffer b0;
|
||||
REQUIRE(v.load(url("archive://test.txt"), b0));
|
||||
auto b0 = v.load(url("archive://test.txt"));
|
||||
REQUIRE(b0);
|
||||
REQUIRE(b0 == buffer("hello", 5));
|
||||
|
||||
auto b1 = v.load_async(url("archive://test.txt")).get();
|
||||
REQUIRE(b1 == buffer("hello", 5));
|
||||
|
||||
str b2;
|
||||
REQUIRE(v.load_as_string(url("archive://test.txt"), b2));
|
||||
auto b2 = v.load_as_string(url("archive://test.txt"));
|
||||
REQUIRE(b2);
|
||||
REQUIRE(b2 == "hello");
|
||||
|
||||
auto b3 = v.load_as_string_async(url("archive://test.txt")).get();
|
||||
@@ -157,15 +157,15 @@ TEST_CASE("vfs"){
|
||||
REQUIRE(b == buffer("world", 5));
|
||||
}
|
||||
{
|
||||
buffer b0;
|
||||
REQUIRE(v.load(url("archive://folder/file.txt"), b0));
|
||||
auto b0 = v.load(url("archive://folder/file.txt"));
|
||||
REQUIRE(b0);
|
||||
REQUIRE(b0 == buffer("world", 5));
|
||||
|
||||
auto b1 = v.load_async(url("archive://folder/file.txt")).get();
|
||||
REQUIRE(b1 == buffer("world", 5));
|
||||
|
||||
str b2;
|
||||
REQUIRE(v.load_as_string(url("archive://folder/file.txt"), b2));
|
||||
auto b2 = v.load_as_string(url("archive://folder/file.txt"));
|
||||
REQUIRE(b2);
|
||||
REQUIRE(b2 == "world");
|
||||
|
||||
auto b3 = v.load_as_string_async(url("archive://folder/file.txt")).get();
|
||||
@@ -174,17 +174,15 @@ TEST_CASE("vfs"){
|
||||
{
|
||||
REQUIRE(v.read(url("archive://TEst.txt")) == input_stream_uptr());
|
||||
|
||||
buffer b0;
|
||||
REQUIRE_FALSE(v.load(url("archive://TEst.txt"), b0));
|
||||
REQUIRE(b0.empty());
|
||||
auto b0 = v.load(url("archive://TEst.txt"));
|
||||
REQUIRE_FALSE(b0);
|
||||
|
||||
REQUIRE_THROWS_AS(
|
||||
v.load_async(url("archive://TEst.txt")).get(),
|
||||
vfs_load_async_exception);
|
||||
|
||||
str b2;
|
||||
REQUIRE_FALSE(v.load_as_string(url("archive://TEst.txt"), b2));
|
||||
REQUIRE(b2.empty());
|
||||
auto b2 = v.load_as_string(url("archive://TEst.txt"));
|
||||
REQUIRE_FALSE(b2);
|
||||
|
||||
REQUIRE_THROWS_AS(
|
||||
v.load_as_string_async(url("archive://TEst.txt")).get(),
|
||||
|
||||
@@ -221,10 +221,10 @@ TEST_CASE("buffer_view") {
|
||||
REQUIRE(v5.data() == b2.data());
|
||||
REQUIRE(v5.size() == 20);
|
||||
|
||||
str32 b3 = make_utf32("hello");
|
||||
u32 b3[3] = {10, 20, 30};
|
||||
buffer_view v6(b3);
|
||||
REQUIRE(v6.data() == b3.data());
|
||||
REQUIRE(v6.size() == 20);
|
||||
REQUIRE(v6.data() == &b3[0]);
|
||||
REQUIRE(v6.size() == 12);
|
||||
}
|
||||
{
|
||||
const char* s0 = "hell";
|
||||
|
||||
@@ -19,24 +19,28 @@ TEST_CASE("url") {
|
||||
REQUIRE(u.empty());
|
||||
REQUIRE(u.scheme().empty());
|
||||
REQUIRE(u.path().empty());
|
||||
REQUIRE(u.schemepath() == "://");
|
||||
}
|
||||
{
|
||||
url u("://file");
|
||||
REQUIRE(!u.empty());
|
||||
REQUIRE(u.scheme().empty());
|
||||
REQUIRE(u.path() == "file");
|
||||
REQUIRE(u.schemepath() == "://file");
|
||||
}
|
||||
{
|
||||
url u("file://");
|
||||
REQUIRE(u.empty());
|
||||
REQUIRE(u.scheme() == "file");
|
||||
REQUIRE(u.path().empty());
|
||||
REQUIRE(u.schemepath() == "file://");
|
||||
}
|
||||
{
|
||||
url u("file://test_file");
|
||||
REQUIRE(!u.empty());
|
||||
REQUIRE(u.scheme() == "file");
|
||||
REQUIRE(u.path() == "test_file");
|
||||
REQUIRE(u.schemepath() == "file://test_file");
|
||||
}
|
||||
{
|
||||
url u("dir/file");
|
||||
|
||||
Reference in New Issue
Block a user