[Positioner] PosUtil: improve assert_uppercase()

This commit is contained in:
Matteo Cypriani 2013-05-18 23:10:01 -04:00 committed by Matteo Cypriani
parent b1fc4a0aa2
commit e749542ddc
1 changed files with 5 additions and 3 deletions

View File

@ -133,10 +133,12 @@ inline void PosUtil::to_upper(std::string &str)
# define assert_uppercase(STR)
#else // NDEBUG
# define assert_uppercase(STR) \
({std::string str_up((STR)) ; \
do { \
std::string str((STR)) ; \
std::string str_up(str) ; \
PosUtil::to_upper(str_up) ; \
assert(str_up == (STR)) ; \
})
assert(str_up == str) ; \
} while (0)
#endif // NDEBUG