Skip to content
Snippets Groups Projects
Verified Commit 3f5296ec authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'dev' into f-value-and-unit

parents 3c2622b6 981ba360
No related branches found
No related tags found
1 merge request!13Tests for values and units
Pipeline #13039 canceled
...@@ -46,7 +46,7 @@ protected: ...@@ -46,7 +46,7 @@ protected:
// fill the file that shall be uploaded // fill the file that shall be uploaded
caosdb::transaction::FileWriter writer(test_upload_file_1); caosdb::transaction::FileWriter writer(test_upload_file_1);
std::string buffer(1024, 'c'); std::string buffer(1024, 'c');
for (int i = 0; i < 8; i++) { for (int i = 0; i < 20; i++) {
writer.write(buffer); writer.write(buffer);
} }
} }
......
...@@ -103,6 +103,7 @@ public: ...@@ -103,6 +103,7 @@ public:
protected: protected:
fs::path test_upload_file_1; fs::path test_upload_file_1;
fs::path test_download_file_1; fs::path test_download_file_1;
size_t test_file_size_kib = 20; // We should test at least something over 16kiB
// Fixture methods ////////////////////////////////////////////////////////// // Fixture methods //////////////////////////////////////////////////////////
...@@ -115,7 +116,7 @@ protected: ...@@ -115,7 +116,7 @@ protected:
// fill the file that shall be uploaded // fill the file that shall be uploaded
FileWriter writer(test_upload_file_1); FileWriter writer(test_upload_file_1);
std::string buffer(1024, 'c'); std::string buffer(1024, 'c');
for (int i = 0; i < 8; i++) { for (int i = 0; i < test_file_size_kib; i++) {
writer.write(buffer); writer.write(buffer);
} }
} }
...@@ -965,14 +966,20 @@ TEST_F(test_transaction, test_file_up_n_download) { ...@@ -965,14 +966,20 @@ TEST_F(test_transaction, test_file_up_n_download) {
ASSERT_FALSE(downloaded_file.HasErrors()); ASSERT_FALSE(downloaded_file.HasErrors());
EXPECT_EQ(downloaded_file.GetLocalPath().string(), EXPECT_EQ(downloaded_file.GetLocalPath().string(),
test_download_file_1.string()); test_download_file_1.string());
EXPECT_EQ(fs::file_size(test_upload_file_1),
fs::file_size(test_download_file_1));
// test_download_file_1
FileReader reader_remote(test_upload_file_1); FileReader reader_remote(test_download_file_1);
std::string buffer_local(1024, 'c'); std::string buffer_local(1024, 'c');
std::string buffer_remote(1024, 'c'); std::string buffer_remote(1024, 'c');
for (int i = 0; i < 8; i++) { std::cout << "Reading kiB chunk";
for (size_t i = 0; i < test_file_size_kib; i++) {
std::cout << " #" << i+1 << "/" << test_file_size_kib;
reader_remote.read(buffer_remote); reader_remote.read(buffer_remote);
EXPECT_EQ(buffer_remote, buffer_local); EXPECT_EQ(buffer_remote, buffer_local);
} }
std::cout << std::endl;
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment