summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/algorithm/tst_algorithm.cpp25
-rw-r--r--tests/auto/debugger/disassembler.pro1
-rw-r--r--tests/auto/debugger/disassembler.qbs2
-rw-r--r--tests/auto/debugger/gdb.pro3
-rw-r--r--tests/auto/debugger/namedemangler.pro1
-rw-r--r--tests/auto/debugger/simplifytypes.pro1
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp33
-rwxr-xr-xtests/system/suite_HELP/tst_HELP06/test.py4
8 files changed, 41 insertions, 29 deletions
diff --git a/tests/auto/algorithm/tst_algorithm.cpp b/tests/auto/algorithm/tst_algorithm.cpp
index 614cf3fa12..47e05b4636 100644
--- a/tests/auto/algorithm/tst_algorithm.cpp
+++ b/tests/auto/algorithm/tst_algorithm.cpp
@@ -42,6 +42,16 @@ int stringToInt(const QString &s)
return s.toInt();
}
+namespace {
+struct Struct
+{
+ Struct(int m) : member(m) {}
+ bool operator==(const Struct &other) const { return member == other.member; }
+
+ int member;
+};
+}
+
void tst_Algorithm::transform()
{
// same container type
@@ -110,16 +120,11 @@ void tst_Algorithm::transform()
Utils::sort(i3);
QCOMPARE(i3, QList<int>({1, 1, 3}));
}
-}
-
-namespace {
-struct Struct
-{
- Struct(int m) : member(m) {}
- bool operator==(const Struct &other) const { return member == other.member; }
-
- int member;
-};
+ {
+ const QList<Struct> list({4, 3, 2, 1, 2});
+ const QList<int> trans = Utils::transform(list, &Struct::member);
+ QCOMPARE(trans, QList<int>({4, 3, 2, 1, 2}));
+ }
}
void tst_Algorithm::sort()
diff --git a/tests/auto/debugger/disassembler.pro b/tests/auto/debugger/disassembler.pro
index c42b8e047d..2a145964ea 100644
--- a/tests/auto/debugger/disassembler.pro
+++ b/tests/auto/debugger/disassembler.pro
@@ -1,4 +1,3 @@
-QTC_LIB_DEPENDS += utils
QT = core network widgets
include(../qttest.pri)
diff --git a/tests/auto/debugger/disassembler.qbs b/tests/auto/debugger/disassembler.qbs
index 35a5aadd59..4d23156527 100644
--- a/tests/auto/debugger/disassembler.qbs
+++ b/tests/auto/debugger/disassembler.qbs
@@ -2,8 +2,6 @@ import qbs
QtcAutotest {
name: "disassembler autotest"
- Depends { name: "ProjectExplorer" }
- Depends { name: "QtcSsh" }
Group {
name: "Sources from Debugger plugin"
prefix: project.debuggerDir
diff --git a/tests/auto/debugger/gdb.pro b/tests/auto/debugger/gdb.pro
index 9cd6e1c475..5b1b3627bf 100644
--- a/tests/auto/debugger/gdb.pro
+++ b/tests/auto/debugger/gdb.pro
@@ -1,12 +1,13 @@
-QTC_LIB_DEPENDS += utils
QT = core network
include(../qttest.pri)
DEBUGGERDIR = $$IDE_SOURCE_TREE/src/plugins/debugger
+UTILSDIR = $$IDE_SOURCE_TREE/src/libs/utils
INCLUDEPATH += $$DEBUGGERDIR
SOURCES += \
tst_gdb.cpp \
$$DEBUGGERDIR/debuggerprotocol.cpp \
+ $$UTILSDIR/processhandle.cpp
diff --git a/tests/auto/debugger/namedemangler.pro b/tests/auto/debugger/namedemangler.pro
index ec021e6eb8..241e1e2759 100644
--- a/tests/auto/debugger/namedemangler.pro
+++ b/tests/auto/debugger/namedemangler.pro
@@ -1,4 +1,3 @@
-QTC_LIB_DEPENDS += utils
QT -= gui
include(../qttest.pri)
diff --git a/tests/auto/debugger/simplifytypes.pro b/tests/auto/debugger/simplifytypes.pro
index df645f1513..7e15fecad3 100644
--- a/tests/auto/debugger/simplifytypes.pro
+++ b/tests/auto/debugger/simplifytypes.pro
@@ -1,4 +1,3 @@
-QTC_LIB_DEPENDS += utils
include(../qttest.pri)
QT += network
QT -= gui widgets
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 08651da1c4..00d2bc05f4 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -682,7 +682,6 @@ class Data
{
public:
Data() {}
- Data(const QString &code) : code(code) {}
Data(const QString &includes, const QString &code)
: includes(includes), code(code)
@@ -5113,7 +5112,8 @@ void tst_Dumpers::dumper_data()
const FloatValue ff("5.88545355e-44");
QTest::newRow("AnonymousStruct")
- << Data("union {\n"
+ << Data("",
+ "union {\n"
" struct { int i; int b; };\n"
" struct { float f; };\n"
" double d;\n"
@@ -5151,7 +5151,8 @@ void tst_Dumpers::dumper_data()
QTest::newRow("CharArrays")
- << Data("char s[] = \"aöa\";\n"
+ << Data("",
+ "char s[] = \"aöa\";\n"
"char t[] = \"aöax\";\n"
"wchar_t w[] = L\"aöa\";\n"
"unused(&s, &t, &w);\n")
@@ -5166,7 +5167,8 @@ void tst_Dumpers::dumper_data()
QTest::newRow("CharPointers")
- << Data("const char *s = \"aöa\";\n"
+ << Data("",
+ "const char *s = \"aöa\";\n"
"const char *t = \"a\\xc3\\xb6\";\n"
"unsigned char uu[] = { 'a', 153 /* ö Latin1 */, 'a' };\n"
"const unsigned char *u = uu;\n"
@@ -5185,7 +5187,7 @@ void tst_Dumpers::dumper_data()
QTest::newRow("GccExtensions")
- << Data(
+ << Data("",
"char v[8] = { 1, 2 };\n"
"char w __attribute__ ((vector_size (8))) = { 1, 2 };\n"
"int y[2] = { 1, 2 };\n"
@@ -5256,7 +5258,8 @@ void tst_Dumpers::dumper_data()
QTest::newRow("Array")
- << Data("double a1[3][3];\n"
+ << Data("",
+ "double a1[3][3];\n"
"for (int i = 0; i != 3; ++i)\n"
" for (int j = 0; j != 3; ++j)\n"
" a1[i][j] = i + j;\n"
@@ -5320,7 +5323,8 @@ void tst_Dumpers::dumper_data()
QTest::newRow("Bitfields")
- << Data("struct S\n"
+ << Data("",
+ "struct S\n"
"{\n"
" S() : x(2), y(3), z(39), c(1), b(0), f(5), d(6), i(7) {}\n"
" unsigned int x : 3;\n"
@@ -5581,7 +5585,8 @@ void tst_Dumpers::dumper_data()
*/
QTest::newRow("LongEvaluation2")
- << Data("const int N = 10000;\n"
+ << Data("",
+ "const int N = 10000;\n"
"int bigv[N];\n"
"for (int i = 0; i < N; ++i)\n"
" bigv[i] = i;\n"
@@ -5941,7 +5946,8 @@ void tst_Dumpers::dumper_data()
// https://bugreports.qt.io/browse/QTCREATORBUG-3611
QTest::newRow("Bug3611")
- << Data("typedef unsigned char byte;\n"
+ << Data("",
+ "typedef unsigned char byte;\n"
"byte f = '2';\n"
"int *x = (int*)&f;\n")
+ Check("f", "50", TypeDef("unsigned char", "byte"));
@@ -6046,7 +6052,8 @@ void tst_Dumpers::dumper_data()
// https://bugreports.qt.io/browse/QTCREATORBUG-6465
QTest::newRow("Bug6465")
- << Data("typedef char Foo[20];\n"
+ << Data("",
+ "typedef char Foo[20];\n"
"Foo foo = \"foo\";\n"
"char bar[20] = \"baz\";\n")
+ CheckType("bar", "char[20]");
@@ -6412,7 +6419,8 @@ void tst_Dumpers::dumper_data()
// The proposed fix has been reported to crash gdb steered from eclipse");
// http://sourceware.org/ml/gdb-patches/2011-12/msg00420.html
QTest::newRow("Gdb10586")
- << Data("struct Test {\n"
+ << Data("",
+ "struct Test {\n"
" struct { int a; float b; };\n"
" struct { int c; float d; };\n"
"} v = {{1, 2}, {3, 4}};\n"
@@ -6426,7 +6434,8 @@ void tst_Dumpers::dumper_data()
QTest::newRow("Gdb10586eclipse")
- << Data("struct { int x; struct { int a; }; struct { int b; }; } "
+ << Data("",
+ "struct { int x; struct { int a; }; struct { int b; }; } "
" v = {1, {2}, {3}};\n"
"struct S { int x, y; } n = {10, 20};\n"
"unused(&v, &n);\n")
diff --git a/tests/system/suite_HELP/tst_HELP06/test.py b/tests/system/suite_HELP/tst_HELP06/test.py
index 610ebc23fd..d1d87f0b04 100755
--- a/tests/system/suite_HELP/tst_HELP06/test.py
+++ b/tests/system/suite_HELP/tst_HELP06/test.py
@@ -57,8 +57,10 @@ def main():
doubleClick(manualQMIObj, 5, 5, 0, Qt.LeftButton)
if not waitFor("not manualQMIObj.collapsed", 2000):
test.warning("It takes more than two seconds to expand the help content tree.")
+ gettingStartedQModelIndex = getQModelIndexStr("text='Getting Started'", manualQModelIndex)
+ doubleClick(gettingStartedQModelIndex, 5, 5, 0, Qt.LeftButton)
mouseClick(waitForObject(getQModelIndexStr("text='Building and Running an Example'",
- manualQModelIndex)), 5, 5, 0, Qt.LeftButton)
+ gettingStartedQModelIndex)))
helpSelector = waitForObject(":Qt Creator_HelpSelector_QComboBox")
pageOpened = "str(helpSelector.currentText).startswith('Building and Running an Example')"
if not waitFor(pageOpened, 10000):