test: Update 6 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 22s
Build-Test-Publish / build (linux/arm64) (push) Successful in 26s

This commit is contained in:
j842
2025-08-17 16:36:20 +12:00
parent c36dadb76f
commit 629210ee9d
6 changed files with 24 additions and 81 deletions

View File

@@ -107,6 +107,21 @@ static bool _recreate_file_(const std::filesystem::path& outpath, uint64_t file_
bool recreate_tree(std::string destination_folder) {
namespace fs = std::filesystem;
bool any_written = false;
{
// File: subdir/nested.txt
fs::path outpath = fs::path(destination_folder) / "subdir/nested.txt";
static const char filedata_base64[] = "VGhpcyBmaWxlIGlzIGluIGEgc3ViZGlyZWN0b3J5Lg==";
// Decode Base64 data
size_t decoded_size = (strlen(filedata_base64) * 3) / 4;
unsigned char* decoded_data = new unsigned char[decoded_size];
size_t actual_size;
base64_decode(filedata_base64, strlen(filedata_base64), decoded_data, &actual_size);
bool file_written = _recreate_file_(outpath, 14153000318456068100ULL, std::filesystem::perms(256), decoded_data, actual_size);
delete[] decoded_data;
any_written = any_written || file_written;
}
{
// File: small.txt
fs::path outpath = fs::path(destination_folder) / "small.txt";
@@ -137,21 +152,6 @@ bool recreate_tree(std::string destination_folder) {
delete[] decoded_data;
any_written = any_written || file_written;
}
{
// File: test3.sh
fs::path outpath = fs::path(destination_folder) / "test3.sh";
static const char filedata_base64[] = "IyEvYmluL2Jhc2gKZWNobyAnSGVsbG8gZnJvbSB0ZXN0IHNjcmlwdCcKZXhpdCAw";
// Decode Base64 data
size_t decoded_size = (strlen(filedata_base64) * 3) / 4;
unsigned char* decoded_data = new unsigned char[decoded_size];
size_t actual_size;
base64_decode(filedata_base64, strlen(filedata_base64), decoded_data, &actual_size);
bool file_written = _recreate_file_(outpath, 14335927320996074478ULL, std::filesystem::perms(488), decoded_data, actual_size);
delete[] decoded_data;
any_written = any_written || file_written;
}
{
// File: test1.txt
fs::path outpath = fs::path(destination_folder) / "test1.txt";
@@ -169,9 +169,9 @@ bool recreate_tree(std::string destination_folder) {
any_written = any_written || file_written;
}
{
// File: subdir/nested.txt
fs::path outpath = fs::path(destination_folder) / "subdir/nested.txt";
static const char filedata_base64[] = "VGhpcyBmaWxlIGlzIGluIGEgc3ViZGlyZWN0b3J5Lg==";
// File: test3.sh
fs::path outpath = fs::path(destination_folder) / "test3.sh";
static const char filedata_base64[] = "IyEvYmluL2Jhc2gKZWNobyAnSGVsbG8gZnJvbSB0ZXN0IHNjcmlwdCcKZXhpdCAw";
// Decode Base64 data
size_t decoded_size = (strlen(filedata_base64) * 3) / 4;
@@ -179,7 +179,7 @@ bool recreate_tree(std::string destination_folder) {
size_t actual_size;
base64_decode(filedata_base64, strlen(filedata_base64), decoded_data, &actual_size);
bool file_written = _recreate_file_(outpath, 14153000318456068100ULL, std::filesystem::perms(256), decoded_data, actual_size);
bool file_written = _recreate_file_(outpath, 14335927320996074478ULL, std::filesystem::perms(488), decoded_data, actual_size);
delete[] decoded_data;
any_written = any_written || file_written;
}