5#include "flutter/fml/platform/darwin/cf_utils.h"
7#include "flutter/testing/testing.h"
12TEST(CFTest, CanCreateRefs) {
15 ASSERT_TRUE(
static_cast<bool>(
string));
18 const auto ref_count = CFGetRetainCount(
string);
24 ASSERT_EQ(ref_count + 1u, CFGetRetainCount(
string));
25 ASSERT_EQ(CFGetRetainCount(string2), CFGetRetainCount(
string));
28 ASSERT_FALSE(string2);
29 ASSERT_EQ(ref_count, CFGetRetainCount(
string));
34 auto string3 = string;
36 ASSERT_EQ(ref_count + 1u, CFGetRetainCount(
string));
37 auto raw_string3 = string3.Release();
38 ASSERT_FALSE(string3);
39 ASSERT_EQ(ref_count + 1u, CFGetRetainCount(
string));
40 CFRelease(raw_string3);
41 ASSERT_EQ(ref_count, CFGetRetainCount(
string));
46 auto string_source = string;
47 ASSERT_TRUE(string_source);
48 auto string_move = std::move(string_source);
49 ASSERT_FALSE(string_source);
50 ASSERT_EQ(ref_count + 1u, CFGetRetainCount(
string));
52 ASSERT_EQ(ref_count, CFGetRetainCount(
string));
57 auto string_move_assign = std::move(
string);
59 ASSERT_EQ(ref_count, CFGetRetainCount(string_move_assign));
void Reset(T instance=nullptr)
TEST(BacktraceTest, CanGatherBacktrace)