Commit 0950060f authored by Tudor Bosman's avatar Tudor Bosman Committed by Sara Golemon

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
parent 01f69815
......@@ -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);
......
......@@ -26,6 +26,7 @@
#include <gtest/gtest.h>
#include <list>
#include <map>
#include <memory>
#include <boost/random.hpp>
......@@ -256,6 +257,23 @@ TEST(FBVector, reserve_consistency) {
}
}
TEST(FBVector, vector_of_maps) {
fbvector<std::map<std::string, std::string>> v;
v.push_back(std::map<std::string, std::string>());
v.push_back(std::map<std::string, std::string>());
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);
......
......@@ -50,7 +50,6 @@ TEST(Traits, containers) {
EXPECT_TRUE (IsRelocatable<vector<F1>>::value);
EXPECT_FALSE((IsRelocatable<pair<F1, F1>>::value));
EXPECT_TRUE ((IsRelocatable<pair<T1, T2>>::value));
EXPECT_TRUE (IsRelocatable<set<F1>>::value);
}
TEST(Traits, original) {
......
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