MCPcopy Create free account
hub / github.com/dartsim/dart / TEST

Function TEST

tests/unit/common/test_SubjectObserver.cpp:91–104  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

89
90//==============================================================================
91TEST(SubjectObserverTests, BasicNotification)
92{
93 TestObserver observer;
94 TestSubject subject;
95
96 observer.track(&subject);
97 EXPECT_EQ(observer.subjectCount(), 1u);
98 EXPECT_EQ(subject.observerCount(), 1u);
99
100 subject.notify();
101 EXPECT_EQ(observer.subjectCount(), 0u);
102 EXPECT_EQ(subject.observerCount(), 0u);
103 EXPECT_EQ(observer.notificationCount(), 1);
104}
105
106//==============================================================================
107TEST(SubjectObserverTests, ObserverDestructorDetaches)

Callers

nothing calls this directly

Calls 7

observerCountMethod · 0.80
notifyMethod · 0.80
setPeerToDestroyMethod · 0.80
trackMethod · 0.45
subjectCountMethod · 0.45
notificationCountMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected