Skip to content

Commit

Permalink
Test not zero-initialized init
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz committed Apr 12, 2018
1 parent a4ffdc2 commit 69f1f2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rcl/test/rcl/test_lexer_lookahead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ TEST_F(CLASSNAME(TestLexerLookaheadFixture, RMW_IMPLEMENTATION), test_init_fini_
rcl_reset_error();
}

TEST_F(CLASSNAME(TestLexerLookaheadFixture, RMW_IMPLEMENTATION), test_init_not_zero_initialized)
{
rcl_lexer_lookahead2_t buffer;
const int not_zero = 1;
buffer.impl = reinterpret_cast<rcl_lexer_lookahead2_impl_t *>(not_zero);
rcl_ret_t ret = rcl_lexer_lookahead2_init(&buffer, "foobar", rcl_get_default_allocator());
EXPECT_EQ(RCL_RET_INVALID_ARGUMENT, ret);
rcl_reset_error();
}

TEST_F(CLASSNAME(TestLexerLookaheadFixture, RMW_IMPLEMENTATION), test_peek)
{
rcl_ret_t ret;
Expand Down

0 comments on commit 69f1f2a

Please sign in to comment.