summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-09-17 15:48:48 +0300
committerOrgad Shaneh <orgads@gmail.com>2017-09-18 11:43:51 +0000
commit2760b9fc67792d84a5abbbba0e1d774fb1883344 (patch)
tree2b4f969cd9dae9076bf07a0c9814d7889edf61e4 /tests
parent0b8ab0d78ab9e17d34c0c5bbc37200877f668ebb (diff)
downloadqt-creator-2760b9fc67792d84a5abbbba0e1d774fb1883344.tar.gz
Dumper: Dump CHAR/WCHAR arrays as strings
Change-Id: I78bdb181e27cc858356c9026fc960135b54cdcbb Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 6fe3d99bdd..91af07f8f1 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -1300,7 +1300,13 @@ void tst_Dumpers::dumper()
"\n#define BREAK qtcDebugBreakFunction();"
"\n\nvoid unused(const void *first,...) { (void) first; }"
"\n#else"
- "\n#include <stdint.h>\n";
+ "\n#include <stdint.h>"
+ "\n#ifndef _WIN32"
+ "\ntypedef char CHAR;"
+ "\ntypedef char *PCHAR;"
+ "\ntypedef wchar_t WCHAR;"
+ "\ntypedef wchar_t *PWCHAR;"
+ "\n#endif\n";
if (m_debuggerEngine == LldbEngine)
//#ifdef Q_OS_MAC
@@ -5197,7 +5203,9 @@ void tst_Dumpers::dumper_data()
"char s[] = \"aöa\";\n"
"char t[] = \"aöax\";\n"
"wchar_t w[] = L\"aöa\";\n"
- "unused(&s, &t, &w);\n")
+ "CHAR ch[] = \"aöa\";\n"
+ "WCHAR wch[] = L\"aöa\";\n"
+ "unused(&s, &t, &w, &ch, &wch);\n")
+ CheckType("s", "char [5]") % NoCdbEngine
+ CheckType("s", "char [4]") % CdbEngine
@@ -5205,7 +5213,12 @@ void tst_Dumpers::dumper_data()
+ CheckType("t", "char [6]") % NoCdbEngine
+ CheckType("t", "char [5]") % CdbEngine
+ Check("t.0", "[0]", "97", "char")
- + CheckType("w", "wchar_t [4]");
+ + CheckType("w", "wchar_t [4]")
+ + Check("ch.0", "[0]", "97", "CHAR")
+ + CheckType("ch", "CHAR [5]") % NoCdbEngine
+ + CheckType("ch", "CHAR [4]") % CdbEngine
+ + Check("wch.0", "[0]", "97", "WCHAR")
+ + CheckType("wch", "WCHAR [4]");
QTest::newRow("CharPointers")