mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
Use smart Refs for IOKit and CoreFoundation objects.
Bug: dawn:89 Change-Id: Idea634bcc65ab4ec017f4e4c2431e95915f533df Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32661 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
f2bc3b3edd
commit
d98e8b70bb
@@ -402,3 +402,17 @@ TEST(Ref, MoveAssignmentDerived) {
|
||||
destination = nullptr;
|
||||
EXPECT_TRUE(deleted);
|
||||
}
|
||||
|
||||
// Test Ref's InitializeInto.
|
||||
TEST(Ref, InitializeInto) {
|
||||
bool deleted = false;
|
||||
RCTest* original = new RCTest(&deleted);
|
||||
|
||||
// InitializeInto acquires the ref.
|
||||
Ref<RCTest> ref;
|
||||
*ref.InitializeInto() = original;
|
||||
EXPECT_EQ(original->GetRefCountForTesting(), 1u);
|
||||
|
||||
ref = nullptr;
|
||||
EXPECT_TRUE(deleted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user