rename test file
This commit is contained in:
37
tests/Host/ExeAppendedZipResourceLoaderTests.cpp
Normal file
37
tests/Host/ExeAppendedZipResourceLoaderTests.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "Host/Windows/ExeAppendedZipResourceLoaderWindows.hpp"
|
||||
#else
|
||||
#include "Host/Linux/ExeAppendedZipResourceLoaderLinux.hpp"
|
||||
#endif
|
||||
|
||||
#include "Base/Logger.hpp"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
using namespace OpenVulkano;
|
||||
|
||||
TEST_CASE("Load zip from exe")
|
||||
{
|
||||
Logger::SetupLogger("", "tests.log");
|
||||
#ifdef _WIN32
|
||||
ExeAppendedZipResourceLoaderWindows loader;
|
||||
#else
|
||||
ExeAppendedZipResourceLoaderLinux loader;
|
||||
#endif
|
||||
auto iconData = loader.GetResource("madvoxel_icon.ico");
|
||||
REQUIRE(!iconData.Empty());
|
||||
|
||||
auto txtFile = loader.GetResource("text.txt");
|
||||
REQUIRE(!txtFile.Empty());
|
||||
|
||||
std::string s(txtFile.Data(), txtFile.Size());
|
||||
REQUIRE(s == "Hello world!");
|
||||
}
|
||||
Reference in New Issue
Block a user