Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Christian Persch
poppler
Commits
96a0c301
Commit
96a0c301
authored
Nov 27, 2018
by
Greg Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add testFromInt to fail if GooString::fromInt is broken again
parent
903983bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
qt5/tests/check_goostring.cpp
qt5/tests/check_goostring.cpp
+20
-0
No files found.
qt5/tests/check_goostring.cpp
View file @
96a0c301
...
...
@@ -14,6 +14,7 @@ private slots:
void
testInsert
();
void
testFormat
();
void
testFromNullptr
();
void
testFromInt
();
};
void
TestGooString
::
testInsertData_data
()
...
...
@@ -161,6 +162,25 @@ void TestGooString::testFromNullptr()
}
}
void
TestGooString
::
testFromInt
()
{
struct
_testcase
{
int
inty
;
const
char
*
str
;
}
cases
[]
=
{
{
12345
,
"12345"
},
{
-
1
,
"-1"
},
{
0
,
"0"
},
{
0x7fffffff
,
"2147483647"
},
{
-
0x7fffffff
-
1
,
"-2147483648"
},
};
for
(
size_t
k
=
0
;
k
<
sizeof
(
cases
)
/
sizeof
(
cases
[
0
]);
++
k
)
{
QScopedPointer
<
GooString
>
str
(
GooString
::
fromInt
(
cases
[
k
].
inty
));
QCOMPARE
(
str
->
c_str
(),
cases
[
k
].
str
);
}
}
QTEST_GUILESS_MAIN
(
TestGooString
)
#include "check_goostring.moc"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment