test: Add 2, update 4 and remove 1 files
This commit is contained in:
@@ -107,21 +107,6 @@ 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";
|
||||
@@ -152,6 +137,21 @@ 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: test3.sh
|
||||
fs::path outpath = fs::path(destination_folder) / "test3.sh";
|
||||
static const char filedata_base64[] = "IyEvYmluL2Jhc2gKZWNobyAnSGVsbG8gZnJvbSB0ZXN0IHNjcmlwdCcKZXhpdCAw";
|
||||
// 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;
|
||||
@@ -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, 14335927320996074478ULL, std::filesystem::perms(488), 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;
|
||||
}
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user