Commit 1c60d757 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by facebook-github-bot-9

Fix Build: address some maybe-uninitialized warnings in folly/test/StringTest.cpp

Summary: [Folly] Fix Build: address some `maybe-uninitialized` warnings in `folly/test/StringTest.cpp`.

Reviewed By: @meyering

Differential Revision: D2535743

fb-gh-sync-id: fa6a071436d22169e2be69cec1abae19851657d2
parent dca00970
...@@ -532,7 +532,7 @@ TEST(PrettyToDouble, Basic) { ...@@ -532,7 +532,7 @@ TEST(PrettyToDouble, Basic) {
PrettyType formatType = testCase.prettyType; PrettyType formatType = testCase.prettyType;
double x = testCase.realValue; double x = testCase.realValue;
std::string testString = testCase.prettyString; std::string testString = testCase.prettyString;
double recoveredX; double recoveredX = 0;
try{ try{
recoveredX = prettyToDouble(testString, formatType); recoveredX = prettyToDouble(testString, formatType);
} catch (std::range_error &ex){ } catch (std::range_error &ex){
...@@ -549,7 +549,7 @@ TEST(PrettyToDouble, Basic) { ...@@ -549,7 +549,7 @@ TEST(PrettyToDouble, Basic) {
for (double x = 1e-18; x < 1e40; x *= 1.9){ for (double x = 1e-18; x < 1e40; x *= 1.9){
bool addSpace = static_cast<PrettyType> (i) == PRETTY_SI; bool addSpace = static_cast<PrettyType> (i) == PRETTY_SI;
for (int it = 0; it < 2; ++it, addSpace = true){ for (int it = 0; it < 2; ++it, addSpace = true){
double recoveredX; double recoveredX = 0;
try{ try{
recoveredX = prettyToDouble(prettyPrint(x, formatType, addSpace), recoveredX = prettyToDouble(prettyPrint(x, formatType, addSpace),
formatType); formatType);
...@@ -1009,7 +1009,7 @@ TEST(Split, std_string_fixed) { ...@@ -1009,7 +1009,7 @@ TEST(Split, std_string_fixed) {
TEST(Split, fixed_convert) { TEST(Split, fixed_convert) {
StringPiece a, d; StringPiece a, d;
int b; int b;
double c; double c = 0;
EXPECT_TRUE(folly::split(':', "a:13:14.7:b", a, b, c, d)); EXPECT_TRUE(folly::split(':', "a:13:14.7:b", a, b, c, d));
EXPECT_EQ("a", a); EXPECT_EQ("a", a);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment