class SymbolTestParentSetter

Defined at line 32 of file ../../src/developer/debug/zxdb/symbols/symbol_test_parent_setter.h

Normally links to symbol parents can not hold a refcount to avoid reference cycles. This is

why the UncachedLazySymbol exists. But some tests want to explicitly set the parent object

without having to construct a whole mock factory.

This object has access to the protected constructor of UncachedLazySymbol and is able to set

an owning reference to a symbol on it for test purposes. To prevent leaks, this object will

clear the parent reference when it goes out of scope.

Example:

TEST(Foo, Bar) {

auto function = fxl::MakeRefCounted

<Function

>(...);

auto code_block = fxl::MakeRefCounted

<CodeBlock

>(...);

// Sets |code_block|'s parent to be |function|.

SymbolTestParentSetter code_block_setter(code_block, function);

... do test ...

}

Public Methods

void SymbolTestParentSetter (fxl::RefPtr<Symbol> symbol, fxl::RefPtr<Symbol> parent)

Defined at line 34 of file ../../src/developer/debug/zxdb/symbols/symbol_test_parent_setter.h

void ~SymbolTestParentSetter ()

Defined at line 39 of file ../../src/developer/debug/zxdb/symbols/symbol_test_parent_setter.h