forked from Green-Sky/tomato
fixes for ci
This commit is contained in:
parent
19844a9423
commit
16d2238f35
@ -91,7 +91,7 @@ std::variant<ByteSpan, std::vector<uint8_t>> File2ZSTDR::read(uint64_t size, int
|
|||||||
|
|
||||||
// actually first we check previous data
|
// actually first we check previous data
|
||||||
if (!_decompressed_buffer.empty()) {
|
if (!_decompressed_buffer.empty()) {
|
||||||
uint64_t required_size = std::min(size, _decompressed_buffer.size());
|
uint64_t required_size = std::min<uint64_t>(size, _decompressed_buffer.size());
|
||||||
ret_data.insert(ret_data.end(), _decompressed_buffer.cbegin(), _decompressed_buffer.cbegin() + required_size);
|
ret_data.insert(ret_data.end(), _decompressed_buffer.cbegin(), _decompressed_buffer.cbegin() + required_size);
|
||||||
_decompressed_buffer.erase(_decompressed_buffer.cbegin(), _decompressed_buffer.cbegin() + required_size);
|
_decompressed_buffer.erase(_decompressed_buffer.cbegin(), _decompressed_buffer.cbegin() + required_size);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ int main(void) {
|
|||||||
|
|
||||||
const auto test1_file_path = temp_dir / "testfile1.zstd";
|
const auto test1_file_path = temp_dir / "testfile1.zstd";
|
||||||
{ // simple write test
|
{ // simple write test
|
||||||
File2WFile f_w_file{test1_file_path.c_str(), true};
|
File2WFile f_w_file{std::string_view{test1_file_path.u8string()}, true};
|
||||||
assert(f_w_file.isGood());
|
assert(f_w_file.isGood());
|
||||||
|
|
||||||
File2ZSTDW f_w_zstd{f_w_file};
|
File2ZSTDW f_w_zstd{f_w_file};
|
||||||
@ -75,7 +75,7 @@ int main(void) {
|
|||||||
assert(std::filesystem::file_size(test1_file_path) != 0);
|
assert(std::filesystem::file_size(test1_file_path) != 0);
|
||||||
|
|
||||||
{ // simple read test (using write test created file)
|
{ // simple read test (using write test created file)
|
||||||
File2RFile f_r_file{test1_file_path.c_str()};
|
File2RFile f_r_file{std::string_view{test1_file_path.u8string()}};
|
||||||
assert(f_r_file.isGood());
|
assert(f_r_file.isGood());
|
||||||
|
|
||||||
File2ZSTDR f_r_zstd{f_r_file};
|
File2ZSTDR f_r_zstd{f_r_file};
|
||||||
@ -156,7 +156,7 @@ int main(void) {
|
|||||||
{ // write
|
{ // write
|
||||||
std::minstd_rand rng_data{11*1337};
|
std::minstd_rand rng_data{11*1337};
|
||||||
|
|
||||||
File2WFile f_w_file{test2_file_path.c_str(), true};
|
File2WFile f_w_file{std::string_view{test2_file_path.u8string()}, true};
|
||||||
assert(f_w_file.isGood());
|
assert(f_w_file.isGood());
|
||||||
|
|
||||||
File2ZSTDW f_w_zstd{f_w_file};
|
File2ZSTDW f_w_zstd{f_w_file};
|
||||||
@ -178,7 +178,7 @@ int main(void) {
|
|||||||
{ // read
|
{ // read
|
||||||
std::minstd_rand rng_data{11*1337};
|
std::minstd_rand rng_data{11*1337};
|
||||||
|
|
||||||
File2RFile f_r_file{test2_file_path.c_str()};
|
File2RFile f_r_file{std::string_view{test2_file_path.u8string()}};
|
||||||
assert(f_r_file.isGood());
|
assert(f_r_file.isGood());
|
||||||
|
|
||||||
File2ZSTDR f_r_zstd{f_r_file};
|
File2ZSTDR f_r_zstd{f_r_file};
|
||||||
@ -217,7 +217,7 @@ int main(void) {
|
|||||||
|
|
||||||
const auto test3_file_path = temp_dir / "testfile3.zstd";
|
const auto test3_file_path = temp_dir / "testfile3.zstd";
|
||||||
{ // large file test write
|
{ // large file test write
|
||||||
File2WFile f_w_file{test3_file_path.c_str(), true};
|
File2WFile f_w_file{std::string_view{test3_file_path.u8string()}, true};
|
||||||
assert(f_w_file.isGood());
|
assert(f_w_file.isGood());
|
||||||
|
|
||||||
File2ZSTDW f_w_zstd{f_w_file};
|
File2ZSTDW f_w_zstd{f_w_file};
|
||||||
@ -249,7 +249,7 @@ int main(void) {
|
|||||||
std::cout << "t3 size on disk: " << std::filesystem::file_size(test3_file_path) << "\n";
|
std::cout << "t3 size on disk: " << std::filesystem::file_size(test3_file_path) << "\n";
|
||||||
|
|
||||||
{ // large file test read
|
{ // large file test read
|
||||||
File2RFile f_r_file{test3_file_path.c_str()};
|
File2RFile f_r_file{std::string_view{test3_file_path.u8string()}};
|
||||||
assert(f_r_file.isGood());
|
assert(f_r_file.isGood());
|
||||||
|
|
||||||
File2ZSTDR f_r_zstd{f_r_file};
|
File2ZSTDR f_r_zstd{f_r_file};
|
||||||
|
Loading…
Reference in New Issue
Block a user