/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/io/RecordIO.h>
#include <sys/types.h>
-#include <unistd.h>
#include <random>
-#include <gflags/gflags.h>
#include <glog/logging.h>
-#include <gtest/gtest.h>
#include <folly/Conv.h>
#include <folly/FBString.h>
#include <folly/Random.h>
#include <folly/experimental/TestUtil.h>
#include <folly/io/IOBufQueue.h>
+#include <folly/portability/GFlags.h>
+#include <folly/portability/GTest.h>
+#include <folly/portability/Unistd.h>
DEFINE_int32(random_seed, folly::randomNumberSeed(), "random seed");
-namespace folly { namespace test {
+namespace folly {
+namespace test {
namespace {
// shortcut
return queue.move();
}
-} // namespace
+} // namespace
TEST(RecordIOTest, Simple) {
TemporaryFile file;
++val;
EXPECT_EQ(1, pwrite(fd, &val, 1, pos));
}
-} // namespace
+} // namespace
TEST(RecordIOTest, Randomized) {
SCOPED_TRACE(to<std::string>("Random seed is ", FLAGS_random_seed));
EXPECT_EQ(records.size(), i);
}
}
+} // namespace test
+} // namespace folly
-}} // namespaces
int main(int argc, char *argv[]) {
testing::InitGoogleTest(&argc, argv);