Skip to content

Commit

Permalink
fix merge (axis test)
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Apr 5, 2024
1 parent 95e0669 commit ead8f24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/fdb5/database/Key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Key::Key(const std::shared_ptr<TypesRegistry> reg) :

Key::Key(const std::string &s, const Rule *rule) :
keys_(),
registry_(rule ? rule->registry() : nullptr), canonical_(false) {
registry_(rule ? rule->registry() : nullptr),
canonical_(false) {

eckit::Tokenizer parse(":", true);
eckit::StringList values;
parse(s, values);
Expand All @@ -43,7 +45,8 @@ Key::Key(const std::string &s, const Rule *rule) :

Key::Key(const eckit::StringDict &keys, const std::shared_ptr<TypesRegistry> reg) :
keys_(keys),
registry_(reg), canonical_(false) {
registry_(reg),
canonical_(false) {

eckit::StringDict::const_iterator it = keys.begin();
eckit::StringDict::const_iterator end = keys.end();
Expand All @@ -53,13 +56,15 @@ Key::Key(const eckit::StringDict &keys, const std::shared_ptr<TypesRegistry> reg
}

Key::Key(eckit::Stream& s, const std::shared_ptr<TypesRegistry> reg) :
registry_(reg), canonical_(reg==nullptr) {
registry_(reg),
canonical_(reg == nullptr) {
decode(s);
}

Key::Key(std::initializer_list<std::pair<const std::string, std::string>> l, const std::shared_ptr<TypesRegistry> reg) :
keys_(l),
registry_(reg), canonical_(false) {
registry_(reg),
canonical_(reg == nullptr) {

for (const auto& kv : keys_) {
names_.emplace_back(kv.first);
Expand Down
6 changes: 3 additions & 3 deletions tests/fdb/database/test_indexaxis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fdb5::Key EXAMPLE_K1{{

fdb5::Key EXAMPLE_K2{{
{"class", "rd"},
{"expver", "0001"},
{"time", "1200"}
{"expver", "0001"},
{"time", "1200"}
}};

fdb5::Key EXAMPLE_K3{{
Expand Down Expand Up @@ -50,9 +50,9 @@ CASE("Insertion and comparison") {
EXPECT(ia1 != ia2);

ia2.insert(EXAMPLE_K1);

EXPECT(!(ia1 == ia2));
EXPECT(ia1 != ia2);

ia1.sort();
ia2.sort();
EXPECT(ia1 == ia2);
Expand Down

0 comments on commit ead8f24

Please sign in to comment.