Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
2ee17c35
Commit
2ee17c35
authored
May 31, 2019
by
Mohamed Fenjiro
Committed by
Sébastien Blin
May 31, 2019
Browse files
unitTest: fix string_utils
Change-Id: I57d3efa477490196e6e935d00a6e98f15d970714
parent
d623c210
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/unitTest/string_utils/testString_utils.cpp
View file @
2ee17c35
...
...
@@ -45,9 +45,9 @@ private:
CPPUNIT_TEST
(
split_string_test
);
CPPUNIT_TEST_SUITE_END
();
const
double
DOUBLE
=
3.14159
265359
;
const
double
DOUBLE
=
3.14159
3
;
const
int
INT
=
42
;
const
std
::
string
PI_DOUBLE
=
"3.14159
265359
"
;
const
std
::
string
PI_DOUBLE
=
"3.14159
3
"
;
const
std
::
string
PI_FLOAT
=
"3.14159265359"
;
const
std
::
string
PI_42
=
"42"
;
};
...
...
@@ -65,16 +65,16 @@ void
StringUtilsTest
::
to_string_test
()
{
// test with double
CPPUNIT_ASSERT
(
to_string
(
DOUBLE
)
==
PI_DOUBLE
);
CPPUNIT_ASSERT
(
std
::
to_string
(
DOUBLE
)
==
PI_DOUBLE
);
// test with float
float
varFloat
=
3.14
;
std
::
string
sVarFloat
=
to_string
(
varFloat
);
std
::
string
sVarFloat
=
std
::
to_string
(
varFloat
);
CPPUNIT_ASSERT
(
sVarFloat
.
at
(
0
)
==
'3'
&&
sVarFloat
.
at
(
1
)
==
'.'
&&
sVarFloat
.
at
(
2
)
==
'1'
&&
sVarFloat
.
at
(
3
)
==
'4'
);
// test with int
CPPUNIT_ASSERT
(
to_string
(
INT
).
compare
(
PI_42
)
==
0
);
CPPUNIT_ASSERT
(
std
::
to_string
(
INT
).
compare
(
PI_42
)
==
0
);
}
void
...
...
Write
Preview
Supports
Markdown
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