Skip to content

Commit

Permalink
Format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Staib Matilla committed Jan 14, 2025
1 parent dd66329 commit 51222e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int64_t LocalFilesystemWrapper::get_modified_time(const std::string& path) {
static_assert(sizeof(int64_t) >= sizeof(std::time_t), "Cannot cast time_t to int64_t");

// there is no portable way to get the modified time of a file in C++17 and earlier
struct stat file_attribute {};
struct stat file_attribute{};
stat(path.c_str(), &file_attribute);
return static_cast<int64_t>(file_attribute.st_mtime);
/* C++20 version, not supported by compilers yet */
Expand Down
4 changes: 2 additions & 2 deletions modyn/storage/src/internal/grpc/storage_service_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ using namespace modyn::storage;
Status StorageServiceImpl::Get( // NOLINT readability-identifier-naming
ServerContext* context, const modyn::storage::GetRequest* request,
ServerWriter<modyn::storage::GetResponse>* writer) {
return Get_Impl<ServerWriter<modyn::storage::GetResponse>>(context, request, writer, /*use_labels=*/true);
return Get_Impl<ServerWriter<modyn::storage::GetResponse>>(context, request, writer, /*include_labels=*/true);
}
Status StorageServiceImpl::GetNL( // NOLINT readability-identifier-naming
ServerContext* context, const modyn::storage::GetRequest* request,
ServerWriter<modyn::storage::GetResponse>* writer) {
return Get_Impl<ServerWriter<modyn::storage::GetResponse>>(context, request, writer, /*use_labels=*/false);
return Get_Impl<ServerWriter<modyn::storage::GetResponse>>(context, request, writer, /*include_labels=*/false);
}

Status StorageServiceImpl::GetNewDataSince( // NOLINT readability-identifier-naming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ TEST_F(CsvFileWrapperTest, TestGetSamplesFromIndices) {
{'J', 'o', 'h', 'n', ',', 'D', 'o', 'e', ',', '2', '5'},
{'M', 'i', 'c', 'h', 'a', 'e', 'l', ',', 'J', 'o', 'h', 'n', 's', 'o', 'n', ',', '3', '5'},
};
const std::vector<std::vector<unsigned char>> actual_samples = file_wrapper.get_samples_from_indices(indices, true);
const std::vector<std::vector<unsigned char>> actual_samples =
file_wrapper.get_samples_from_indices(indices, /*include_labels=*/true);

ASSERT_EQ(actual_samples, expected_samples);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ TEST(SingleSampleFileWrapperTest, TestGetSamplesFromIndices) {
EXPECT_CALL(*filesystem_wrapper, get(testing::_)).WillOnce(testing::Return(bytes));
::SingleSampleFileWrapper file_wrapper = ::SingleSampleFileWrapper(file_name, config, filesystem_wrapper);
const std::vector<uint64_t> indices = {0};
const std::vector<std::vector<unsigned char>> samples = file_wrapper.get_samples_from_indices(indices, true);
const std::vector<std::vector<unsigned char>> samples =
file_wrapper.get_samples_from_indices(indices, /*include_labels*/ true);
ASSERT_EQ(samples.size(), 1);
ASSERT_EQ(samples[0].size(), 8);
ASSERT_EQ((samples)[0][0], '1');
Expand Down

0 comments on commit 51222e6

Please sign in to comment.