Commit d8944b17 authored by 's avatar

Fix logging_striplog_test.sh in debug mode. Fixes issue 108.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@99 eb4d4688-79bd-11dd-afb4-1d65580434c0
parent 5a05c303
......@@ -60,9 +60,16 @@ die () {
# Check that the string literals are appropriately stripped. This will
# not be the case in debug mode.
check_eq "`get_strings logging_striptest0`" "COND ERROR FATAL INFO WARNING "
check_eq "`get_strings logging_striptest2`" "COND ERROR FATAL "
check_eq "`get_strings logging_striptest10`" ""
mode=`GLOG_check_mode=1 ./logging_striptest0 2> /dev/null`
if [ "$mode" = "opt" ];
then
echo "In OPT mode"
check_eq "`get_strings logging_striptest0`" "COND ERROR FATAL INFO USAGE WARNING "
check_eq "`get_strings logging_striptest2`" "COND ERROR FATAL USAGE "
check_eq "`get_strings logging_striptest10`" ""
else
echo "In DBG mode; not checking strings"
fi
# Check that LOG(FATAL) aborts even for large STRIP_LOG
......
......@@ -39,6 +39,7 @@
#include "config.h"
DECLARE_bool(logtostderr);
GLOG_DEFINE_bool(check_mode, false, "Prints 'opt' or 'dbg'");
using std::string;
using namespace GOOGLE_NAMESPACE;
......@@ -58,6 +59,10 @@ std::ostream &operator<<(std::ostream &str, const A&) {return str;}
int main(int argc, char* argv[]) {
FLAGS_logtostderr = true;
InitGoogleLogging(argv[0]);
if (FLAGS_check_mode) {
printf("%s\n", DEBUG_MODE ? "dbg" : "opt");
return 0;
}
LOG(INFO) << "TESTMESSAGE INFO";
LOG(WARNING) << 2 << "something" << "TESTMESSAGE WARNING"
<< 1 << 'c' << A() << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment