diff --git a/test/test_ccaosdb.cpp b/test/test_ccaosdb.cpp index ecc3eb59b63950f76d5cd342ba0fac8aa17c2639..c588d10aba92a055a1b7c784618c920802933051 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 d98c68faa0ba576272c25d0274d5a0e4a4e10fcc..683f85f600fde6f25f88867bf7ff4c6c388a7402 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -96,6 +96,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 ////////////////////////////////////////////////////////// @@ -108,7 +109,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); } } @@ -951,14 +952,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; } /*