- TEST_SPEC.md: Updated test directory structure to reflect Core/Asset, Core/IO, and Resources/<Type> subdirectories - TEST_SPEC.md: Updated module names and test counts (852 total) - TEST_SPEC.md: Updated build commands for new Resources subdirectories - README.md: Updated engine structure with Core/Asset/ and Core/IO/ - README.md: Updated Resources section with layered architecture - README.md: Updated test coverage table with accurate counts
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#include <gtest/gtest.h>
|
|
#include <XCEngine/Core/IO/FileArchive.h>
|
|
#include <XCEngine/Core/Containers/String.h>
|
|
|
|
using namespace XCEngine::Resources;
|
|
using namespace XCEngine::Containers;
|
|
|
|
namespace {
|
|
|
|
TEST(FileArchive, DefaultConstructor) {
|
|
FileArchive archive;
|
|
EXPECT_FALSE(archive.IsValid());
|
|
}
|
|
|
|
TEST(FileArchive, OpenInvalidPath) {
|
|
FileArchive archive;
|
|
bool result = archive.Open("invalid/path/to/archive.zip");
|
|
EXPECT_TRUE(result);
|
|
EXPECT_TRUE(archive.IsValid());
|
|
}
|
|
|
|
TEST(FileArchive, GetPath) {
|
|
FileArchive archive;
|
|
EXPECT_EQ(archive.GetPath(), "");
|
|
}
|
|
|
|
TEST(FileArchive, Exists) {
|
|
FileArchive archive;
|
|
EXPECT_FALSE(archive.Exists("test.txt"));
|
|
}
|
|
|
|
TEST(FileArchive, GetSize) {
|
|
FileArchive archive;
|
|
EXPECT_EQ(archive.GetSize("test.txt"), 0u);
|
|
}
|
|
|
|
TEST(FileArchive, Read) {
|
|
FileArchive archive;
|
|
char buffer[100] = {0};
|
|
bool result = archive.Read("test.txt", buffer, 100, 0);
|
|
EXPECT_FALSE(result);
|
|
}
|
|
|
|
TEST(FileArchive, Enumerate) {
|
|
FileArchive archive;
|
|
Array<String> files(10);
|
|
archive.Enumerate("*.txt", files);
|
|
EXPECT_EQ(files.Size(), 0u);
|
|
}
|
|
|
|
} // namespace
|