From 346acb7e3f4f254a703fe68d834e514b6c7b88d7 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:34:35 +0100 Subject: [PATCH] Fixed test on ubuntu --- tests/fineftp_test/src/permission_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/fineftp_test/src/permission_test.cpp b/tests/fineftp_test/src/permission_test.cpp index 9645e27..d1c2add 100644 --- a/tests/fineftp_test/src/permission_test.cpp +++ b/tests/fineftp_test/src/permission_test.cpp @@ -14,9 +14,19 @@ namespace { +#ifdef WIN32 constexpr int curl_return_code_quote_command_error = 21; constexpr int curl_return_code_upload_failed = 25; constexpr int curl_return_code_login_failed = 67; +#else + // I have absolutely no idea, why the return codes are shifted by 8 bit on Linux and macOS. + // However, for some reasons they are. + // Here are the original return codes, that are only true on Windows: + // https://everything.curl.dev/usingcurl/returns + constexpr int curl_return_code_quote_command_error = 21 << 8; + constexpr int curl_return_code_upload_failed = 25 << 8; + constexpr int curl_return_code_login_failed = 67 << 8; +#endif // WIN32 struct DirPreparer {