Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
42c083cd
Commit
42c083cd
authored
14 years ago
by
Bill King
Browse files
Options
Downloads
Patches
Plain Diff
tests: fixes compile
parent
9532d4a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/auto/utils_stringutils/tst_stringutils.cpp
+18
-18
18 additions, 18 deletions
tests/auto/utils_stringutils/tst_stringutils.cpp
tests/auto/utils_stringutils/utils_stringutils.pro
+2
-0
2 additions, 0 deletions
tests/auto/utils_stringutils/utils_stringutils.pro
with
20 additions
and
18 deletions
tests/auto/utils_stringutils/tst_stringutils.cpp
+
18
−
18
View file @
42c083cd
...
@@ -46,30 +46,30 @@ void tst_StringUtils::testWithTildeHomePath()
...
@@ -46,30 +46,30 @@ void tst_StringUtils::testWithTildeHomePath()
{
{
#ifndef Q_OS_WIN
#ifndef Q_OS_WIN
// home path itself
// home path itself
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()),
Q
Latin1
String
(
"~"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()),
QString
::
fromLatin1
(
"~"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QLatin1Char
(
'/'
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QLatin1Char
(
'/'
)),
Q
Latin1
String
(
"~"
));
QString
::
fromLatin1
(
"~"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
Q
Latin1
String
(
"/unclean/.."
)
+
QDir
::
homePath
()),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QString
::
fromLatin1
(
"/unclean/.."
)
+
QDir
::
homePath
()),
Q
Latin1
String
(
"~"
));
QString
::
fromLatin1
(
"~"
));
// sub of home path
// sub of home path
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/foo"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/foo"
)),
Q
Latin1
String
(
"~/foo"
));
QString
::
fromLatin1
(
"~/foo"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/foo/"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/foo/"
)),
Q
Latin1
String
(
"~/foo"
));
QString
::
fromLatin1
(
"~/foo"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/some/path/file.txt"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/some/path/file.txt"
)),
Q
Latin1
String
(
"~/some/path/file.txt"
));
QString
::
fromLatin1
(
"~/some/path/file.txt"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/some/unclean/../path/file.txt"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/some/unclean/../path/file.txt"
)),
Q
Latin1
String
(
"~/some/path/file.txt"
));
QString
::
fromLatin1
(
"~/some/path/file.txt"
));
// not sub of home path
// not sub of home path
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/../foo"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/../foo"
)),
QString
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/../foo"
)));
QString
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/../foo"
)));
#else
#else
// windows: should return same as input
// windows: should return same as input
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()),
QDir
::
homePath
());
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()),
QDir
::
homePath
());
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/foo"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/foo"
)),
QDir
::
homePath
()
+
Q
Latin1
String
(
"/foo"
));
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/foo"
));
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/../foo"
)),
QCOMPARE
(
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/../foo"
)),
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
Q
Latin1
String
(
"/../foo"
)));
Utils
::
withTildeHomePath
(
QDir
::
homePath
()
+
QString
::
fromLatin1
(
"/../foo"
)));
#endif
#endif
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/auto/utils_stringutils/utils_stringutils.pro
+
2
−
0
View file @
42c083cd
...
@@ -3,6 +3,8 @@ DEFINES += QTCREATOR_UTILS_LIB
...
@@ -3,6 +3,8 @@ DEFINES += QTCREATOR_UTILS_LIB
UTILS_PATH
=
..
/../../
src
/
libs
/
utils
UTILS_PATH
=
..
/../../
src
/
libs
/
utils
DEFINES
-=
QT_USE_FAST_OPERATOR_PLUS
QT_USE_FAST_CONCATENATION
INCLUDEPATH
+=
$$
UTILS_PATH
INCLUDEPATH
+=
$$
UTILS_PATH
#
Input
#
Input
SOURCES
+=
tst_stringutils
.
cpp
\
SOURCES
+=
tst_stringutils
.
cpp
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment