projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix some of the warning/errors clang 3.1 reports - 2
[folly.git]
/
folly
/
experimental
/
test
/
GenTest.cpp
diff --git
a/folly/experimental/test/GenTest.cpp
b/folly/experimental/test/GenTest.cpp
index 64a738432ff1d11ccef67e446b2d9a6378a52dc5..de2e4afbebe63a099daa330afb99e65c64877f32 100644
(file)
--- a/
folly/experimental/test/GenTest.cpp
+++ b/
folly/experimental/test/GenTest.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
2
Facebook, Inc.
+ * Copyright 201
3
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-251,8
+251,8
@@
TEST(Gen, OrderTake) {
TEST(Gen, MinBy) {
EXPECT_EQ(7, seq(1, 10)
TEST(Gen, MinBy) {
EXPECT_EQ(7, seq(1, 10)
- | minBy([](int i) {
-
auto
d = i - 6.8;
+ | minBy([](int i)
-> double
{
+
double
d = i - 6.8;
return d * d;
}));
}
return d * d;
}));
}
@@
-403,7
+403,7
@@
TEST(Gen, Any) {
}
TEST(Gen, Yielders) {
}
TEST(Gen, Yielders) {
- auto gen = GENERATOR(int
,
{
+ auto gen = GENERATOR(int
)
{
for (int i = 1; i <= 5; ++i) {
yield(i);
}
for (int i = 1; i <= 5; ++i) {
yield(i);
}
@@
-411,7
+411,7
@@
TEST(Gen, Yielders) {
for (int i = 3; ; ++i) {
yield(i * i);
}
for (int i = 3; ; ++i) {
yield(i * i);
}
- }
)
;
+ };
vector<int> expected {
1, 2, 3, 4, 5, 7, 9, 16, 25
};
vector<int> expected {
1, 2, 3, 4, 5, 7, 9, 16, 25
};
@@
-419,30
+419,30
@@
TEST(Gen, Yielders) {
}
TEST(Gen, NestedYield) {
}
TEST(Gen, NestedYield) {
- auto nums = GENERATOR(int
,
{
+ auto nums = GENERATOR(int
)
{
for (int i = 1; ; ++i) {
yield(i);
}
for (int i = 1; ; ++i) {
yield(i);
}
- }
)
;
- auto gen = GENERATOR(int
,
{
+ };
+ auto gen = GENERATOR(int
)
{
nums | take(10) | yield;
seq(1, 5) | [&](int i) {
yield(i);
};
nums | take(10) | yield;
seq(1, 5) | [&](int i) {
yield(i);
};
- }
)
;
+ };
EXPECT_EQ(70, gen | sum);
}
TEST(Gen, MapYielders) {
auto gen = seq(1, 5)
| map([](int n) {
EXPECT_EQ(70, gen | sum);
}
TEST(Gen, MapYielders) {
auto gen = seq(1, 5)
| map([](int n) {
- return GENERATOR(int
,
{
+ return GENERATOR(int
)
{
int i;
for (i = 1; i < n; ++i)
yield(i);
for (; i >= 1; --i)
yield(i);
int i;
for (i = 1; i < n; ++i)
yield(i);
for (; i >= 1; --i)
yield(i);
- }
)
;
+ };
})
| concat;
vector<int> expected {
})
| concat;
vector<int> expected {
@@
-619,7
+619,7
@@
TEST(StringGen, EmptySplit) {
{
auto pieces = split(",,", ',') | take(1) | collect;
EXPECT_EQ(1, pieces.size());
{
auto pieces = split(",,", ',') | take(1) | collect;
EXPECT_EQ(1, pieces.size());
- EXPECT_EQ("", pieces[
1
]);
+ EXPECT_EQ("", pieces[
0
]);
}
}
}
}