Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
anand1976 committed Dec 2, 2024
1 parent 1bc76b0 commit dab0550
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions db/external_sst_file_basic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,9 @@ TEST_F(ExternalSSTFileBasicTest, Basic) {
DestroyAndRecreateExternalSSTFilesDir();
}

TEST_F(ExternalSSTFileBasicTest,AlignedBufferedWrite) {
TEST_F(ExternalSSTFileBasicTest, AlignedBufferedWrite) {
class AlignedWriteFS : public FileSystemWrapper {
public:

explicit AlignedWriteFS(const std::shared_ptr<FileSystem>& _target)
: FileSystemWrapper(_target) {}
~AlignedWriteFS() override {}
Expand All @@ -286,8 +285,7 @@ TEST_F(ExternalSSTFileBasicTest,AlignedBufferedWrite) {
class AlignedWritableFile : public FSWritableFileOwnerWrapper {
public:
AlignedWritableFile(std::unique_ptr<FSWritableFile>& file)
: FSWritableFileOwnerWrapper(std::move(file)),
last_write_(false) {}
: FSWritableFileOwnerWrapper(std::move(file)), last_write_(false) {}

using FSWritableFileOwnerWrapper::Append;
IOStatus Append(const Slice& data, const IOOptions& options,
Expand All @@ -314,7 +312,7 @@ TEST_F(ExternalSSTFileBasicTest,AlignedBufferedWrite) {

Options options = CurrentOptions();
std::shared_ptr<AlignedWriteFS> aligned_fs =
std::make_shared<AlignedWriteFS>(env_->GetFileSystem());
std::make_shared<AlignedWriteFS>(env_->GetFileSystem());
std::unique_ptr<Env> wrap_env(
new CompositeEnvWrapper(options.env, aligned_fs));
options.env = wrap_env.get();
Expand Down
10 changes: 5 additions & 5 deletions util/file_reader_writer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ TEST_F(WritableFileWriterTest, IncrementalBuffer) {
TEST_F(WritableFileWriterTest, AlignedBufferedWrites) {
class FakeWF : public FSWritableFile {
public:
explicit FakeWF(std::string* _file_data)
: file_data_(_file_data) {}
explicit FakeWF(std::string* _file_data) : file_data_(_file_data) {}
~FakeWF() override = default;

using FSWritableFile::Append;
Expand Down Expand Up @@ -302,12 +301,13 @@ TEST_F(WritableFileWriterTest, AlignedBufferedWrites) {
env_options.writable_file_max_buffer_size = 64 * 1024 * 1024;
std::string actual;
std::unique_ptr<FakeWF> wf(new FakeWF(&actual));
std::unique_ptr<WritableFileWriter> writer(new WritableFileWriter(
std::move(wf), "" /* don't care */, env_options));
std::unique_ptr<WritableFileWriter> writer(
new WritableFileWriter(std::move(wf), "" /* don't care */, env_options));

std::string target;
uint32_t left =
static_cast<uint32_t>(2 * env_options.writable_file_max_buffer_size);;
static_cast<uint32_t>(2 * env_options.writable_file_max_buffer_size);
;
while (left > 0) {
uint32_t num = 4096 + r.Uniform(8192);
num = std::min<uint32_t>(num, left);
Expand Down

0 comments on commit dab0550

Please sign in to comment.