Skip to content

Commit

Permalink
Fix tests compilation on OpenBSD (#1246)
Browse files Browse the repository at this point in the history
* Fix test_eh_thread on OpenBSD
* Disable test_malloc_compliance on OpenBSD
---------
Signed-off-by: pavelkumbrasev <[email protected]>
  • Loading branch information
pavelkumbrasev authored Nov 8, 2023
1 parent 7b8018f commit ab7f370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/tbb/test_eh_thread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2020-2022 Intel Corporation
Copyright (c) 2020-2023 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -75,7 +75,7 @@ class Thread {
mValid = false;
pthread_attr_t attr;
// Limit the stack size not to consume all virtual memory on 32 bit platforms.
std::size_t stacksize = utils::max(128*1024, PTHREAD_STACK_MIN);
std::size_t stacksize = utils::max(std::size_t(128*1024), std::size_t(PTHREAD_STACK_MIN));
if (pthread_attr_init(&attr) == 0 && pthread_attr_setstacksize(&attr, stacksize) == 0) {
mValid = pthread_create(&mHandle, &attr, thread_routine, /* arg = */ nullptr) == 0;
}
Expand Down
7 changes: 6 additions & 1 deletion test/tbbmalloc/test_malloc_compliance.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2022 Intel Corporation
Copyright (c) 2005-2023 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,10 @@

#include "oneapi/tbb/detail/_config.h"

// There is no RLIMIT_AS on OpenBSD.
// Therefore, the tests for memory limit is unreasonable.
#if !__OpenBSD__

#define __TBB_NO_IMPLICIT_LINKAGE 1
#include "tbb/scalable_allocator.h"

Expand Down Expand Up @@ -1091,3 +1095,4 @@ TEST_CASE("MAIN TEST") {
}

#endif /* __TBB_WIN8UI_SUPPORT */
#endif /* Enable test */

0 comments on commit ab7f370

Please sign in to comment.