diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-03 20:30:12 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 20:30:12 +0300 | 
| commit | 90aa693f2a9ece9f1c624dba245f202e126bca5b (patch) | |
| tree | fae8bca7bb3f3ac05972803e2fefc05de8542408 /indra/llcorehttp/tests | |
| parent | 5593cde0e85d4d4b06efacffb6f00ed2fadb188a (diff) | |
| parent | 5ffcd3dc88892a651fe9a95974280efb85e18a8b (diff) | |
Merge Changes for support of apple silicon on macOS
Mac Arm
Diffstat (limited to 'indra/llcorehttp/tests')
| -rwxr-xr-x | indra/llcorehttp/tests/llcorehttp_test.cpp | 57 | ||||
| -rw-r--r-- | indra/llcorehttp/tests/test_httprequest.hpp | 13 | ||||
| -rw-r--r-- | indra/llcorehttp/tests/test_refcounted.hpp | 3 | 
3 files changed, 10 insertions, 63 deletions
diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp index c0cc2c8030..c7c50e6166 100755 --- a/indra/llcorehttp/tests/llcorehttp_test.cpp +++ b/indra/llcorehttp/tests/llcorehttp_test.cpp @@ -41,11 +41,7 @@  #include "test_httpstatus.hpp"  #include "test_refcounted.hpp"  #include "test_httpoperation.hpp" -// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release -// builds for reasons not yet diagnosed. -#if ! (LL_DARWIN && LL_RELEASE)  #include "test_httprequest.hpp" -#endif  #include "test_httpheaders.hpp"  #include "test_httprequestqueue.hpp"  #include "_httpservice.h" @@ -53,9 +49,6 @@  #include "llproxy.h"  #include "llcleanup.h" -void ssl_thread_id_callback(CRYPTO_THREADID*); -void ssl_locking_callback(int mode, int type, const char * file, int line); -  #if 0   // lltut provides main and runner  namespace tut @@ -80,27 +73,10 @@ int main()  #endif // 0 -int ssl_mutex_count(0); -LLCoreInt::HttpMutex ** ssl_mutex_list = NULL; -  void init_curl()  {      curl_global_init(CURL_GLOBAL_ALL); -    ssl_mutex_count = CRYPTO_num_locks(); -    if (ssl_mutex_count > 0) -    { -        ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count]; - -        for (int i(0); i < ssl_mutex_count; ++i) -        { -            ssl_mutex_list[i] = new LLCoreInt::HttpMutex; -        } - -        CRYPTO_set_locking_callback(ssl_locking_callback); -        CRYPTO_THREADID_set_callback(ssl_thread_id_callback); -    } -      LLProxy::getInstance();  } @@ -108,39 +84,6 @@ void init_curl()  void term_curl()  {      SUBSYSTEM_CLEANUP(LLProxy); - -    CRYPTO_set_locking_callback(NULL); -    for (int i(0); i < ssl_mutex_count; ++i) -    { -        delete ssl_mutex_list[i]; -    } -    delete [] ssl_mutex_list; -} - - -void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid) -{ -#if defined(WIN32) -    CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread()); -#else -    CRYPTO_THREADID_set_pointer(pthreadid, pthread_self()); -#endif -} - - -void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */) -{ -    if (type >= 0 && type < ssl_mutex_count) -    { -        if (mode & CRYPTO_LOCK) -        { -            ssl_mutex_list[type]->lock(); -        } -        else -        { -            ssl_mutex_list[type]->unlock(); -        } -    }  } diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index aed906bb8f..77ed8df066 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -454,6 +454,10 @@ void HttpRequestTestObjectType::test<4>()  template <> template <>  void HttpRequestTestObjectType::test<5>()  { +#ifndef LL_WINDOWS +    skip("Skip due to issues with testing pthread cancellation"); +#endif +      ScopedCurlInit ready;      set_test_name("HttpRequest Spin (soft) + NoOp + hard termination"); @@ -517,6 +521,9 @@ void HttpRequestTestObjectType::test<5>()  template <> template <>  void HttpRequestTestObjectType::test<6>()  { +#ifndef LL_WINDOWS +    skip("Skip due to issues with testing pthread cancellation"); +#endif      ScopedCurlInit ready;      set_test_name("HttpRequest Spin + NoOp + hard termination"); @@ -2779,7 +2786,7 @@ void HttpRequestTestObjectType::test<22>()          for (int i(0); i < test_count; ++i)          {              char buffer[128]; -            sprintf(buffer, "/bug2295/%d/", i); +            snprintf(buffer, sizeof(buffer), "/bug2295/%d/", i);              HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,                                                           url_base + buffer,                                                           0, @@ -2810,7 +2817,7 @@ void HttpRequestTestObjectType::test<22>()          for (int i(0); i < test2_count; ++i)          {              char buffer[128]; -            sprintf(buffer, "/bug2295/00000012/%d/", i); +            snprintf(buffer, sizeof(buffer), "/bug2295/00000012/%d/", i);              HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,                                                           url_base + buffer,                                                           0, @@ -2841,7 +2848,7 @@ void HttpRequestTestObjectType::test<22>()          for (int i(0); i < test3_count; ++i)          {              char buffer[128]; -            sprintf(buffer, "/bug2295/inv_cont_range/%d/", i); +            snprintf(buffer, sizeof(buffer), "/bug2295/inv_cont_range/%d/", i);              HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,                                                           url_base + buffer,                                                           0, diff --git a/indra/llcorehttp/tests/test_refcounted.hpp b/indra/llcorehttp/tests/test_refcounted.hpp index c0c8e78413..eb23a25545 100644 --- a/indra/llcorehttp/tests/test_refcounted.hpp +++ b/indra/llcorehttp/tests/test_refcounted.hpp @@ -28,8 +28,6 @@  #include "_refcounted.h" -// disable all of this because it's hanging win64 builds? -#if ! (LL_WINDOWS && ADDRESS_SIZE == 64)  using namespace LLCoreInt;  namespace tut @@ -122,5 +120,4 @@ namespace tut          ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED);      }  } -#endif  // disabling on Win64  #endif  // TEST_LLCOREINT_REF_COUNTED_H_  | 
