mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 06:53:47 -07:00
Initial release
This commit is contained in:
23
tests/slic3rutils/CMakeLists.txt
Normal file
23
tests/slic3rutils/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
get_filename_component(_TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
add_executable(${_TEST_NAME}_tests
|
||||
${_TEST_NAME}_tests_main.cpp
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
target_link_libraries(${_TEST_NAME}_tests Setupapi.lib)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r_gui libslic3r Catch2::Catch2WithMain)
|
||||
set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests")
|
||||
|
||||
if (WIN32)
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug)
|
||||
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_Release)
|
||||
else()
|
||||
orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
catch_discover_tests(${_TEST_NAME}_tests)
|
||||
60
tests/slic3rutils/slic3rutils_tests_main.cpp
Normal file
60
tests/slic3rutils/slic3rutils_tests_main.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "slic3r/Utils/Http.hpp"
|
||||
|
||||
TEST_CASE("Check SSL certificates paths", "[Http][NotWorking]") {
|
||||
|
||||
Slic3r::Http g = Slic3r::Http::get("https://github.com/");
|
||||
|
||||
unsigned status = 0;
|
||||
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.perform_sync();
|
||||
|
||||
REQUIRE(status == 200);
|
||||
}
|
||||
|
||||
TEST_CASE("Http digest authentication", "[Http][NotWorking]") {
|
||||
Slic3r::Http g = Slic3r::Http::get("https://httpbingo.org/digest-auth/auth/guest/guest");
|
||||
|
||||
g.auth_digest("guest", "guest");
|
||||
|
||||
unsigned status = 0;
|
||||
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.perform_sync();
|
||||
|
||||
REQUIRE(status == 200);
|
||||
}
|
||||
|
||||
TEST_CASE("Http basic authentication", "[Http][NotWorking]") {
|
||||
Slic3r::Http g = Slic3r::Http::get("https://httpbingo.org/basic-auth/guest/guest");
|
||||
|
||||
g.auth_basic("guest", "guest");
|
||||
|
||||
unsigned status = 0;
|
||||
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
||||
status = http_status;
|
||||
});
|
||||
|
||||
g.perform_sync();
|
||||
|
||||
REQUIRE(status == 200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user