Go to the documentation of this file.
39 #include <glog/logging.h>
44 #ifdef HAVE_LIB_GFLAGS
45 #include <gflags/gflags.h>
46 using namespace GFLAGS_NAMESPACE;
50 "Run demangle_unittest in filter mode");
56 static const char *
DemangleIt(
const char *
const mangled) {
57 static char demangled[4096];
58 if (
Demangle(mangled, demangled,
sizeof(demangled))) {
65 #if defined(GLOG_OS_WINDOWS)
67 #if defined(HAVE_DBGHELP) && !defined(NDEBUG)
70 "public: static void __cdecl Foo::func(int)",
73 "public: static void __cdecl Foo::func(int)",
76 "int __cdecl foobarArray(int * const)",
85 const size_t size = 10;
86 char tmp[
size] = { 0 };
87 const char *demangled =
"foobar()";
88 const char *mangled =
"_Z6foobarv";
127 string test_file = FLAGS_test_srcdir +
"/src/demangle_unittest.txt";
128 ifstream
f(test_file.c_str());
132 while (getline(
f, line)) {
134 if (line.empty() || line[0] ==
'#') {
139 string::size_type tab_pos = line.find(
'\t');
141 string mangled = line.substr(0, tab_pos);
142 string demangled = line.substr(tab_pos + 1);
149 int main(
int argc,
char **argv) {
150 #ifdef HAVE_LIB_GFLAGS
157 if (FLAGS_demangle_filter) {
160 while (getline(cin, line,
'\n')) {
164 }
else if (argc > 1) {
TEST(Demangle, CornerCases)
#define EXPECT_EQ(val1, val2)
_START_GOOGLE_NAMESPACE_ void InitGoogleTest(int *, char **)
bool Demangle(const char *mangled, char *out, size_t out_size)
int main(int argc, char **argv)
#define EXPECT_NE(val1, val2)
#define EXPECT_STREQ(val1, val2)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
static int FLAGS_logtostderr
#define EXPECT_TRUE(cond)
static const char * DemangleIt(const char *const mangled)
#define EXPECT_FALSE(cond)
GLOG_DEFINE_bool(demangle_filter, false, "Run demangle_unittest in filter mode")
void ParseCommandLineFlags(int *argc, char **argv)
void InitGoogleLogging(const char *argv0)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:49