Fix back() of empty deque in context_mm_black test
authorAndres Notzli <andres.noetzli@gmail.com>
Wed, 2 Nov 2016 23:55:37 +0000 (16:55 -0700)
committerAndres Notzli <andres.noetzli@gmail.com>
Thu, 3 Nov 2016 00:09:55 +0000 (17:09 -0700)
commit520e4a0638675dad2fa66a50e5fd64786c6f889f
tree008e517455ecfcdfa3d25a17d2ba73a9638d0593
parentf1427165156dff24d7b8ca0690088e4182ccdbd4
Fix back() of empty deque in context_mm_black test

The `testPushPop()` test case does a pop out of scope at the end that
lead to UB in `ContextManager::pop()` because it did a `deque::back()`
on an empty deque without checking. This commit adds an assertion in the
`ContextManager` and checks that the test case triggers the assertion.
src/context/context_mm.cpp
test/unit/context/context_mm_black.h