Skip to content

Commit

Permalink
Merge branch 'hotfix/5.11.28'
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Dec 8, 2023
2 parents c9a73f0 + 74c93f2 commit aecde64
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.11.27
5.11.28
56 changes: 41 additions & 15 deletions tests/fdb/type/test_toKey.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,23 @@ CASE( "Step & ClimateDaily - expansion" ) {
EXPECT(key.canonicalValue("date") == "20210427");
EXPECT(key.valuesToString() == "20210427:dacl");

// TODO - the following two test cases (12:aa and 12am) returns 1200 instead of failing
// fix requires eckit::Time changes

// key.set("time", "12:aa");
// EXPECT_THROWS(key.canonicalValue("time"));
key.set("time", "12:aa");
EXPECT_THROWS(key.canonicalValue("time"));

// key.set("time", "12am");
// EXPECT_THROWS(key.canonicalValue("time"));
key.set("time", "12am");
EXPECT_THROWS(key.canonicalValue("time"));

key.set("time", "123");
EXPECT_THROWS(key.canonicalValue("time"));
EXPECT(key.canonicalValue("time") == "0123");

key.set("time", "1:23");
EXPECT_THROWS(key.canonicalValue("time"));
EXPECT(key.canonicalValue("time") == "0123");

key.set("time", "01::23::45");
EXPECT(key.canonicalValue("time") == "0123");
EXPECT_THROWS(key.canonicalValue("time"));

key.set("time", ":01:23:45:");
EXPECT(key.canonicalValue("time") == "0123");
EXPECT_THROWS(key.canonicalValue("time"));

key.set("time", "12:99");
EXPECT_THROWS(key.canonicalValue("time"));
Expand Down Expand Up @@ -115,11 +112,8 @@ CASE( "Step & ClimateDaily - expansion" ) {
key.set("time", "00:00:00");
EXPECT(key.canonicalValue("time") == "0000");

key.set("time", "00");
EXPECT(key.canonicalValue("time") == "0000");

EXPECT(key.valuesToString() == "20210427:dacl:0000");

key.set("class", "ei");
key.set("expver", "7799");
key.set("domain", "g");
Expand All @@ -137,7 +131,39 @@ CASE( "Step & ClimateDaily - expansion" ) {

EXPECT(key.canonicalValue("date") == "0427");
EXPECT(key.canonicalValue("time") == "0000");

std::cout << key.valuesToString() << std::endl;

EXPECT(key.valuesToString() == "0427:dacl:0000:ei:7799:g:pb:pl:2-12:99:100:50:129.128");

key.set("step", "00");
EXPECT(key.canonicalValue("step") == "0");

key.set("step", "1");
EXPECT(key.canonicalValue("step") == "1");

key.set("step", "0-1");
EXPECT(key.canonicalValue("step") == "0-1");

key.set("step", "30m");
// std::cout << key.get("step") << " " << key.canonicalValue("step") << std::endl;
EXPECT(key.canonicalValue("step") == "30m");

key.set("step", "60m");
// std::cout << key.get("step") << " " << key.canonicalValue("step") << std::endl;
EXPECT(key.canonicalValue("step") == "1");

key.set("step", "30m-60m");
// std::cout << key.get("step") << " " << key.canonicalValue("step") << std::endl;
EXPECT(key.canonicalValue("step") == "30m-60m");

key.set("step", "30m-1");
// std::cout << key.get("step") << " " << key.canonicalValue("step") << std::endl;
EXPECT(key.canonicalValue("step") == "30m-60m");

key.set("step", "60m-120m");
// std::cout << key.get("step") << " " << key.canonicalValue("step") << std::endl;
EXPECT(key.canonicalValue("step") == "1-2");
}


Expand Down

0 comments on commit aecde64

Please sign in to comment.