Dumpers: Add a show case for C-style strings

Change-Id: Ic70761ffcd76bdfed7879c222d471b50a8b32c0b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Orgad Shaneh
2017-05-04 23:55:07 +03:00
committed by hjk
parent 9ff3064561
commit f97657b15e
2 changed files with 75 additions and 0 deletions

View File

@@ -6860,6 +6860,25 @@ void tst_Dumpers::dumper_data()
+ Check("arr.2.baz", "5", "int");
QTest::newRow("StringDisplay")
<< Data("#include <string.h>\n"
"struct QtcDumperTest_String"
"{\n"
" char *first;\n"
" const char *second = \"second\";\n"
" const char third[6] = \"third\";\n"
" QtcDumperTest_String()\n"
" {\n"
" first = new char[6];\n"
" strcpy(first, \"first\");\n"
" }\n"
" ~QtcDumperTest_String() { delete[] first; }\n"
"};\n\n",
"QtcDumperTest_String str; unused(&str);\n")
+ Cxx11Profile()
+ Check("str", "first, second, third", "QtcDumperTest_String");
QTest::newRow("UndefinedStaticMembers")
<< Data("struct Foo { int a = 15; static int b; }; \n",
"Foo f; unused(&f);\n")