mirror of
https://github.com/GerbilSoft/minizip-ng.git
synced 2025-06-18 11:35:34 -04:00
updating test expectations
This commit is contained in:
parent
c7b6cb09e9
commit
1eb579d9bc
@ -11,6 +11,7 @@
|
||||
#include "mz.h"
|
||||
#include "mz_os.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
struct resolve_path_param {
|
||||
@ -51,9 +52,17 @@ INSTANTIATE_TEST_SUITE_P(os, path_resolve, testing::ValuesIn(resolve_path_tests)
|
||||
|
||||
TEST_P(path_resolve, os) {
|
||||
const auto ¶m = GetParam();
|
||||
std::string path = param.path;
|
||||
std::string expected_path = param.expected_path;
|
||||
char output[256];
|
||||
|
||||
memset(output, 'z', sizeof(output));
|
||||
mz_path_resolve(param.path, output, sizeof(output));
|
||||
EXPECT_STREQ(output, param.expected_path);
|
||||
// The expectation is that archiving+unarchiving data on a system should preserve its structure.
|
||||
// So on Windows backslash should be preserved, while on UNIX slash should be preserved.
|
||||
#ifndef _WIN32
|
||||
std::replace(path.begin(), path.end(), '\\', '/');
|
||||
std::replace(expected_path.begin(), expected_path.end(), '\\', '/');
|
||||
#endif
|
||||
mz_path_resolve(path.c_str(), output, sizeof(output));
|
||||
EXPECT_STREQ(output, expected_path.c_str());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user