- Downloader : HEAD + Range avec reprise, re-probe à chaque essai (URL CDN signées), retries bornés, fichier partiel conservé, repli sans Range, annulation, progression et ETA - licence : fichier temporaire renommé à la fin ; le placeholder vide « licenses_<id>_<ts>.tar » renvoyé par Majestic pendant la génération de la licence est jeté et la requête relancée (cause du bug ENOENT de l'app officielle) - archives (libarchive) : vérification complète, extraction qui ignore UpdateInfo.xml, refus des chemins absolus/.., liens ignorés (FAT32) - persistance : vehicles.json compatible avec l'app officielle (BOM inclus), réglages + téléchargement en attente, chemins XDG / Haiku, écriture atomique - CLI : download, verify, extract ; Ctrl-C annule proprement - tests : faux CDN (coupures, sans Range, 4xx, annulation), tar ustar/gnu/pax/v7, corruption, traversal (42 cas, 322 assertions) - validé en réel : firmware RCC 8,39 Go téléchargé, interrompu, repris et vérifié (ustar, 16 entrées) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
21 lines
585 B
CMake
21 lines
585 B
CMake
find_package(doctest QUIET)
|
|
|
|
add_executable(openpu_tests
|
|
main.cpp
|
|
test_vin.cpp
|
|
test_models.cpp
|
|
test_http.cpp
|
|
test_api_client.cpp
|
|
test_download.cpp
|
|
test_archive.cpp
|
|
test_storage.cpp
|
|
)
|
|
find_package(LibArchive REQUIRED)
|
|
target_link_libraries(openpu_tests PRIVATE openpu_core openpu_warnings LibArchive::LibArchive)
|
|
if(TARGET doctest::doctest)
|
|
target_link_libraries(openpu_tests PRIVATE doctest::doctest)
|
|
endif()
|
|
target_compile_definitions(openpu_tests PRIVATE OPENPU_FIXTURES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/fixtures")
|
|
|
|
add_test(NAME openpu_tests COMMAND openpu_tests)
|