diff --git a/test/test_ccaosdb.cpp b/test/test_ccaosdb.cpp index 64ef436100824845e52b2a39511e6ed1a86a365c..ff01b9ba95d8dcded153aa9f94260a98cf5b3c53 100644 --- a/test/test_ccaosdb.cpp +++ b/test/test_ccaosdb.cpp @@ -46,7 +46,7 @@ protected: // fill the file that shall be uploaded caosdb::transaction::FileWriter writer(test_upload_file_1); std::string buffer(1024, 'c'); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 20; i++) { writer.write(buffer); } } diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index 59a2b225344f373cb54735cb336ad1fab0c3238d..1ca135a2fb93d2b25a91b2c151f928c68228e918 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -103,6 +103,7 @@ public: protected: fs::path test_upload_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 ////////////////////////////////////////////////////////// @@ -115,7 +116,7 @@ protected: // fill the file that shall be uploaded FileWriter writer(test_upload_file_1); 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); } } @@ -965,14 +966,20 @@ TEST_F(test_transaction, test_file_up_n_download) { ASSERT_FALSE(downloaded_file.HasErrors()); EXPECT_EQ(downloaded_file.GetLocalPath().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_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); EXPECT_EQ(buffer_remote, buffer_local); } + std::cout << std::endl; } /*