Skip to content

Commit

Permalink
fix ldb_cmd_test.cc build with nondefault -DROCKSDB_NAMESPACE (#12173)
Browse files Browse the repository at this point in the history
Summary:
I landed #12159 which had the below compiler error when using `-DROCKSDB_NAMESPACE`, which broke the CircleCI "build-linux-static_lib-alt_namespace-status_checked" job:

```
tools/ldb_cmd_test.cc:1213:21: error: 'rocksdb' does not name a type
 1213 |   int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
      |                     ^~~~~~~
tools/ldb_cmd_test.cc:1213:35: error: expected unqualified-id before '&' token
 1213 |   int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
      |                                   ^
tools/ldb_cmd_test.cc:1213:35: error: expected ')' before '&' token
 1213 |   int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
      |              ~                    ^
      |                                   )
tools/ldb_cmd_test.cc:1213:35: error: expected ';' at end of member declaration
 1213 |   int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
      |                                   ^
      |                                    ;
tools/ldb_cmd_test.cc:1213:37: error: 'a' does not name a type
 1213 |   int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
      |                                     ^
...
```

Pull Request resolved: #12173

Test Plan:
```
$ make clean && make OPT="-DROCKSDB_NAMESPACE=alternative_rocksdb_ns" ldb_cmd_test -j56
```

Reviewed By: pdillinger

Differential Revision: D52373797

Pulled By: ajkr

fbshipit-source-id: 8597aaae65a5333831fef66d85072827c5fb1187
  • Loading branch information
ajkr authored and facebook-github-bot committed Dec 21, 2023
1 parent 8d50a7c commit 15487b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/ldb_cmd_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ TEST_F(LdbCmdTest, RenameDbAndLoadOptions) {

class MyComparator : public Comparator {
public:
int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override {
int Compare(const Slice& a, const Slice& b) const override {
return a.compare(b);
}
void FindShortSuccessor(std::string* /*key*/) const override {}
Expand Down

0 comments on commit 15487b8

Please sign in to comment.