Skip to content

Commit

Permalink
Added test for nullptr decoration.
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielHare committed Jul 30, 2014
1 parent 27bd0e9 commit 4fa7fb5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/autowiring/test/AutoFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ TEST_F(AutoFilterTest, VerifyNoMultiDecorate) {
EXPECT_LT(0, filterA->m_called) << "Filter was not called after being fully satisfied";
}

TEST_F(AutoFilterTest, VerifyNoNullCheckout) {
AutoCurrentContext()->Initiate();
AutoRequired<AutoPacketFactory> factory;

std::shared_ptr<Decoration<0>> nulldeco;
ASSERT_FALSE(nulldeco);

auto packet = factory->NewPacket();
EXPECT_THROW(packet->Checkout(nulldeco), std::exception) << "Failed to catch null checkout" << std::endl;
EXPECT_THROW(packet->Decorate(nulldeco), std::exception) << "Failed to catch null decoration" << std::endl;
}

TEST_F(AutoFilterTest, VerifyInterThreadDecoration) {
AutoRequired<FilterB> filterB;
AutoRequired<AutoPacketFactory> factory;
Expand Down

0 comments on commit 4fa7fb5

Please sign in to comment.