Page MenuHomePhorge

Add kazv-io-job-test
Needs ReviewPublic

Authored by nannanko on Mar 14 2025, 6:04 AM.
Tags
None
Referenced Files
F1321955: D210.1748054607.diff
Thu, May 22, 7:43 PM
F1314700: D210.1748033127.diff
Thu, May 22, 1:45 PM
F1312687: D210.1748030375.diff
Thu, May 22, 12:59 PM
Subscribers
None

Details

Summary

Add tests for kazv-io-job.cpp

Type: skip

Test Plan

Verify unit tests pass.

Diff Detail

Repository
rK kazv
Branch
nannanko/kazv-io-test
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 367
Build 717: GitLab CI for kazv
Build 716: arc lint + arc unit

Event Timeline

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