Skip to content

Commit c33e39f

Browse files
authored
emulator: Trivial fixes for Google C++ style.
- CamelCase for functions in tests that did not conform to that standard. - Mechanical fix by ./ci/cloudbuild/build.sh -t checkers-ci All tests continue to pass.
1 parent 337d8bd commit c33e39f

4 files changed

Lines changed: 136 additions & 145 deletions

File tree

google/cloud/bigtable/emulator/column_family.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ class ColumnFamily {
293293
return rows_.find(row_key);
294294
}
295295

296-
iterator erase(
297-
std::map<std::string, ColumnFamilyRow>::iterator row_it) {
296+
iterator erase(std::map<std::string, ColumnFamilyRow>::iterator row_it) {
298297
return rows_.erase(row_it);
299298
}
300299

google/cloud/bigtable/emulator/conditional_mutations_test.cc

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct SetCellParams {
1818
std::string data;
1919
};
2020

21-
StatusOr<std::shared_ptr<Table>> create_table(
21+
StatusOr<std::shared_ptr<Table>> CreateTable(
2222
std::string const& table_name, std::vector<std::string>& column_families) {
2323
::google::bigtable::admin::v2::Table schema;
2424
schema.set_name(table_name);
@@ -30,11 +30,10 @@ StatusOr<std::shared_ptr<Table>> create_table(
3030
return Table::Create(schema);
3131
}
3232

33-
Status has_cell(
34-
std::shared_ptr<google::cloud::bigtable::emulator::Table>& table,
35-
std::string const& column_family, std::string const& row_key,
36-
std::string const& column_qualifier, int64_t timestamp_micros,
37-
std::string const& value) {
33+
Status HasCell(std::shared_ptr<google::cloud::bigtable::emulator::Table>& table,
34+
std::string const& column_family, std::string const& row_key,
35+
std::string const& column_qualifier, int64_t timestamp_micros,
36+
std::string const& value) {
3837
auto column_family_it = table->find(column_family);
3938
if (column_family_it == table->end()) {
4039
return NotFoundError(
@@ -80,7 +79,7 @@ Status has_cell(
8079
return Status();
8180
}
8281

83-
Status set_cells(
82+
Status SetCells(
8483
std::shared_ptr<google::cloud::bigtable::emulator::Table>& table,
8584
std::string const& table_name, std::string const& row_key,
8685
std::vector<SetCellParams>& set_cell_params) {
@@ -110,7 +109,7 @@ TEST(ConditionalMutations, TestTrueMutations) {
110109
auto const* const false_mutation_value = "set by a false mutation";
111110

112111
std::vector<std::string> column_families = {column_family_name};
113-
auto maybe_table = create_table(table_name, column_families);
112+
auto maybe_table = CreateTable(table_name, column_families);
114113

115114
ASSERT_STATUS_OK(maybe_table);
116115
auto table = maybe_table.value();
@@ -136,10 +135,10 @@ TEST(ConditionalMutations, TestTrueMutations) {
136135

137136
std::vector<SetCellParams> v = {
138137
{column_family_name, "column_2", 1000, "some_value"}};
139-
ASSERT_STATUS_OK(set_cells(table, table_name, row_key, v));
140-
ASSERT_STATUS_OK(has_cell(table, v[0].column_family_name, row_key,
141-
v[0].column_qualifier, v[0].timestamp_micros,
142-
v[0].data));
138+
ASSERT_STATUS_OK(SetCells(table, table_name, row_key, v));
139+
ASSERT_STATUS_OK(HasCell(table, v[0].column_family_name, row_key,
140+
v[0].column_qualifier, v[0].timestamp_micros,
141+
v[0].data));
143142

144143
google::bigtable::v2::CheckAndMutateRowRequest cond_mut_with_pass_all;
145144

@@ -156,15 +155,13 @@ TEST(ConditionalMutations, TestTrueMutations) {
156155

157156
// pass_all_filter means that true_mutation should have succeeded,
158157
// so check for the true_mutation cell value e.t.c.
159-
ASSERT_STATUS_OK(has_cell(table, column_family_name, row_key,
160-
column_qualifier, timestamp_micros,
161-
true_mutation_value));
158+
ASSERT_STATUS_OK(HasCell(table, column_family_name, row_key, column_qualifier,
159+
timestamp_micros, true_mutation_value));
162160

163161
// And just for good measure, ensure that false_mutation was not written.
164-
ASSERT_EQ(false,
165-
has_cell(table, column_family_name, row_key, column_qualifier,
166-
timestamp_micros, false_mutation_value)
167-
.ok());
162+
ASSERT_EQ(false, HasCell(table, column_family_name, row_key, column_qualifier,
163+
timestamp_micros, false_mutation_value)
164+
.ok());
168165
}
169166

170167
TEST(ConditionalMutations, RejectInvalidRequest) {
@@ -177,7 +174,7 @@ TEST(ConditionalMutations, RejectInvalidRequest) {
177174
auto const* const false_mutation_value = "set by a false mutation";
178175

179176
std::vector<std::string> column_families = {column_family_name};
180-
auto maybe_table = create_table(table_name, column_families);
177+
auto maybe_table = CreateTable(table_name, column_families);
181178

182179
ASSERT_STATUS_OK(maybe_table);
183180
auto table = maybe_table.value();

google/cloud/bigtable/emulator/drop_row_range_test.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ Status SetCellsInMultipleRows(
9393
return Status();
9494
}
9595

96-
Status HasCell(
97-
std::shared_ptr<google::cloud::bigtable::emulator::Table>& table,
98-
std::string const& column_family, std::string const& row_key,
99-
std::string const& column_qualifier, int64_t timestamp_micros,
100-
std::string const& value) {
96+
Status HasCell(std::shared_ptr<google::cloud::bigtable::emulator::Table>& table,
97+
std::string const& column_family, std::string const& row_key,
98+
std::string const& column_qualifier, int64_t timestamp_micros,
99+
std::string const& value) {
101100
auto column_family_it = table->find(column_family);
102101
if (column_family_it == table->end()) {
103102
return NotFoundError(

0 commit comments

Comments
 (0)