Make file backed strings dup the provided file descriptor.

Reviewed By: mhorowitz

Differential Revision: D4326645

fbshipit-source-id: 2741f1fead4f42ae76787f8a70c1e787445b827d
This commit is contained in:
Ashok Menon
2016-12-16 06:03:22 -08:00
committed by Facebook Github Bot
parent 349bbb54f7
commit fa082796a5
3 changed files with 14 additions and 5 deletions

View File

@@ -37,7 +37,6 @@ TEST(JSBigFileString, MapWholeFileTest) {
JSBigFileString bigStr {fd, size};
// Test
ASSERT_EQ(fd, bigStr.fd());
ASSERT_STREQ(data.c_str(), bigStr.c_str());
}
@@ -53,7 +52,6 @@ TEST(JSBigFileString, MapPartTest) {
JSBigFileString bigStr {fd, needle.size(), offset};
// Test
ASSERT_EQ(fd, bigStr.fd());
ASSERT_EQ(needle.length(), bigStr.size());
for (unsigned int i = 0; i < needle.length(); ++i) {
ASSERT_EQ(needle[i], bigStr.c_str()[i]);