Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "absl/debugging/internal/stack_consumption.h"
00017
00018 #ifdef ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION
00019
00020 #include <string.h>
00021
00022 #include "gtest/gtest.h"
00023 #include "absl/base/internal/raw_logging.h"
00024
00025 namespace absl {
00026 namespace debugging_internal {
00027 namespace {
00028
00029 static void SimpleSignalHandler(int signo) {
00030 char buf[100];
00031 memset(buf, 'a', sizeof(buf));
00032
00033
00034 if (signo == 0) {
00035 ABSL_RAW_LOG(INFO, "%p", static_cast<void*>(buf));
00036 }
00037 }
00038
00039 TEST(SignalHandlerStackConsumptionTest, MeasuresStackConsumption) {
00040
00041 EXPECT_GE(GetSignalHandlerStackConsumption(SimpleSignalHandler), 100);
00042 }
00043
00044 }
00045 }
00046 }
00047
00048 #endif // ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION