Page MenuHomePhorge

Add kazv-io-job-test
ClosedPublic

Authored by nannanko on Mar 14 2025, 6:04 AM.

Details

Summary

Add tests for kazv-io-job.cpp

Type: skip

Test Plan

Verify unit tests pass.

Diff Detail

Repository
rK kazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Harbormaster returned this revision to the author for changes because remote builds failed.Mar 14 2025, 6:17 AM
Harbormaster failed remote builds in B337: Diff 557!

Fix code for libhttpserver 0.18.2

tusooa requested changes to this revision.Mar 15 2025, 5:56 PM
tusooa added inline comments.
CMakeLists.txt
81
src/tests/CMakeLists.txt
36

Use the PkgConfig::libhttpserver target, because it also includes the include dirs of that target. Also, use ecm_add_test to single out this one test that requires extra link libraries.

src/tests/kazv-io-job-test.cpp
62–66

This suffers from time-of-check, time-of-use problem. By the time the port is closed, it may no longer be free.

Use PkgConfig correctly, fixed time-of-check, time-of-use problem for port.

nannanko marked 3 inline comments as done.

Use QHttpServer instead of libhttpserver, and add upload test.

Add test about pause among downloading.

Add test for cancel download.

Upgrade the required Qt version to 6.8

Add test for KazvIODownloadJob::fileName and KazvIOUploadJob::fileName

verify KazvIOBaseJob::isResulted

I don't know how to implement testUploadPause and testUploadCancel. All other than that have been completed.

I don't know how to implement testUploadPause and testUploadCancel. All other than that have been completed.

Add testUploadPause and testUploadCancel

Add qt6-httpserver-dev dependency

Add qt6-websocket dependency

tusooa requested changes to this revision.Wed, May 21, 8:57 PM
tusooa added inline comments.
src/kazv-file.cpp
20–21
src/kazv-io-job.cpp
246
src/tests/kazv-io-job-test.cpp
88–92

Instead of repeatedly using #if, we better use it only once:

#if ...
    using QHttpServerResponderRef = QHttpServerResponder &&;
#else
    using QHttpServerResponderRef = QHttpServerResponder &;
#endif

and then use QHttpServerResponderRef as the argument type. Also, don't forget to include comments to indicate why it is necessary to do so.

This revision now requires changes to proceed.Wed, May 21, 8:57 PM

Use a separate constructor for unit test

Don't use a separate constructor for unit test

This revision is now accepted and ready to land.Sun, May 25, 6:25 AM
This revision was automatically updated to reflect the committed changes.