Fix build error of test w/ NDEBUG

also be friendly to GCC < 4.7