diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-06-12 16:33:38 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-12 16:08:45 +0200 |
commit | 583108004ce3fc9025c5e6d5d3b7809a19b6d310 (patch) | |
tree | 5cca07f6273a7c6ba9add28bc14d112c6e7005f7 /AK/Tests/TestRefPtr.cpp | |
parent | 04668106386c9b8ae9f62f56bef9378f2e1cb914 (diff) | |
download | serenity-583108004ce3fc9025c5e6d5d3b7809a19b6d310.zip |
AK: Use unsigned int for refcount
And while fixing all the tests that look at ref_count(),
sneak in a fix for the test suite name.
Diffstat (limited to 'AK/Tests/TestRefPtr.cpp')
-rw-r--r-- | AK/Tests/TestRefPtr.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/AK/Tests/TestRefPtr.cpp b/AK/Tests/TestRefPtr.cpp index 8b5d02dc8c..5208dc03ad 100644 --- a/AK/Tests/TestRefPtr.cpp +++ b/AK/Tests/TestRefPtr.cpp @@ -37,48 +37,48 @@ TEST_CASE(basics) { RefPtr<Object> object = adopt(*new Object); EXPECT(object.ptr() != nullptr); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); object->ref(); - EXPECT_EQ(object->ref_count(), 2); + EXPECT_EQ(object->ref_count(), 2u); object->unref(); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); { NonnullRefPtr another = *object; - EXPECT_EQ(object->ref_count(), 2); + EXPECT_EQ(object->ref_count(), 2u); } - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); } TEST_CASE(assign_reference) { RefPtr<Object> object = adopt(*new Object); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); object = *object; - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); } TEST_CASE(assign_ptr) { RefPtr<Object> object = adopt(*new Object); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); object = object.ptr(); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); } TEST_CASE(assign_moved_self) { RefPtr<Object> object = adopt(*new Object); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); object = move(object); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); } TEST_CASE(assign_copy_self) { RefPtr<Object> object = adopt(*new Object); - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); #ifdef __clang__ #pragma clang diagnostic push @@ -89,7 +89,7 @@ TEST_CASE(assign_copy_self) #pragma clang diagnostic pop #endif - EXPECT_EQ(object->ref_count(), 1); + EXPECT_EQ(object->ref_count(), 1u); } TEST_MAIN(RefPtr) |