summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorDominik Madarasz <zaklaus@outlook.com>2020-05-16 10:58:29 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-16 11:01:14 +0200
commit4e27c58be70d9ddb26c00f62ca982cf398ae70ba (patch)
tree2a8532ca341a9f24b37471c03eab73df5a9ea41f /AK
parent76bcd284f9dddc93f975cccabae9dc4c040c5a53 (diff)
downloadserenity-4e27c58be70d9ddb26c00f62ca982cf398ae70ba.zip
Build: FreeBSD support
Diffstat (limited to 'AK')
-rw-r--r--AK/Tests/TestRefPtr.cpp11
-rw-r--r--AK/Tests/TestWeakPtr.cpp9
2 files changed, 19 insertions, 1 deletions
diff --git a/AK/Tests/TestRefPtr.cpp b/AK/Tests/TestRefPtr.cpp
index cf03da32c2..8b5d02dc8c 100644
--- a/AK/Tests/TestRefPtr.cpp
+++ b/AK/Tests/TestRefPtr.cpp
@@ -79,7 +79,16 @@ TEST_CASE(assign_copy_self)
{
RefPtr<Object> object = adopt(*new Object);
EXPECT_EQ(object->ref_count(), 1);
- object = object;
+
+ #ifdef __clang__
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wself-assign-overloaded"
+ #endif
+ object = object;
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif
+
EXPECT_EQ(object->ref_count(), 1);
}
diff --git a/AK/Tests/TestWeakPtr.cpp b/AK/Tests/TestWeakPtr.cpp
index d272c1fc61..0d724e5e90 100644
--- a/AK/Tests/TestWeakPtr.cpp
+++ b/AK/Tests/TestWeakPtr.cpp
@@ -29,6 +29,11 @@
#include <AK/Weakable.h>
#include <AK/WeakPtr.h>
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#endif
+
class SimpleWeakable : public Weakable<SimpleWeakable> {
public:
SimpleWeakable() {}
@@ -37,6 +42,10 @@ private:
int m_member { 123 };
};
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
TEST_CASE(basic_weak)
{
WeakPtr<SimpleWeakable> weak1;