From: Tudor Bosman Date: Thu, 22 Aug 2013 14:26:48 +0000 (-0700) Subject: std::map and std::set are not relocatable X-Git-Tag: v0.22.0~896 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0950060f04ad3f1411d0833cd74d4e505640b7ce;p=folly.git std::map and std::set are not relocatable Summary: https://github.com/facebook/folly/issues/35 @override-unit-failures hphp tests independently broken Test Plan: test added Reviewed By: delong.j@fb.com FB internal diff: D939323 --- diff --git a/folly/Traits.h b/folly/Traits.h index e5f6b38c..37bd58d3 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -422,8 +422,6 @@ FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::basic_string); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::vector); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::list); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::deque); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_4(std::map); -FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::set); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::unique_ptr); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::shared_ptr); FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function); diff --git a/folly/test/FBVectorTest.cpp b/folly/test/FBVectorTest.cpp index a8a1b2ac..d3747fcd 100644 --- a/folly/test/FBVectorTest.cpp +++ b/folly/test/FBVectorTest.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -256,6 +257,23 @@ TEST(FBVector, reserve_consistency) { } } +TEST(FBVector, vector_of_maps) { + fbvector> v; + + v.push_back(std::map()); + v.push_back(std::map()); + + EXPECT_EQ(2, v.size()); + + v[1]["hello"] = "world"; + EXPECT_EQ(0, v[0].size()); + EXPECT_EQ(1, v[1].size()); + + v[0]["foo"] = "bar"; + EXPECT_EQ(1, v[0].size()); + EXPECT_EQ(1, v[1].size()); +} + int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); google::ParseCommandLineFlags(&argc, &argv, true); diff --git a/folly/test/TraitsTest.cpp b/folly/test/TraitsTest.cpp index 784524e1..8e7b5d7a 100644 --- a/folly/test/TraitsTest.cpp +++ b/folly/test/TraitsTest.cpp @@ -50,7 +50,6 @@ TEST(Traits, containers) { EXPECT_TRUE (IsRelocatable>::value); EXPECT_FALSE((IsRelocatable>::value)); EXPECT_TRUE ((IsRelocatable>::value)); - EXPECT_TRUE (IsRelocatable>::value); } TEST(Traits, original) {