diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-24 09:07:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-24 09:09:57 +0000 |
commit | 06202a90d6857a66512e10fef771b36196fc2d03 (patch) | |
tree | 7917dcbdb72cefd6e19df1e2a1947e3bb22822bd /o3tl | |
parent | b13b78a9067e069886379deec9cb3eaa1d85f91e (diff) |
coverity#1399266 Uncaught exception
Change-Id: I1066fda2258e6acbbbad23256f815975564e5e61
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/qa/cow_wrapper_clients.hxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx index 138f496a773e..7750b71845d0 100644 --- a/o3tl/qa/cow_wrapper_clients.hxx +++ b/o3tl/qa/cow_wrapper_clients.hxx @@ -22,6 +22,7 @@ #include "o3tl/cow_wrapper.hxx" #include "cppunit/extensions/HelperMacros.h" +#include <assert.h> /* Definition of Cow_Wrapper_Clients classes */ @@ -153,15 +154,12 @@ struct BogusRefCountPolicy static sal_uInt32 s_nEndOfScope; typedef sal_uInt32 ref_count_t; static void incrementCount( ref_count_t& rCount ) { - if(s_bShouldIncrement) - { - ++rCount; - s_bShouldIncrement = false; - } - else - CPPUNIT_FAIL("Ref-counting policy incremented when it should not have."); + assert(s_bShouldIncrement && "Ref-counting policy incremented when it should not have."); + ++rCount; + s_bShouldIncrement = false; } static bool decrementCount( ref_count_t& rCount ) { + assert((s_nEndOfScope || s_bShouldDecrement) && "Ref-counting policy decremented when it should not have."); if(s_nEndOfScope) { --rCount; @@ -172,8 +170,6 @@ struct BogusRefCountPolicy --rCount; s_bShouldDecrement = false; } - else - CPPUNIT_FAIL("Ref-counting policy decremented when it should not have."); return rCount != 0; } }; |