Skip to content

Commit

Permalink
And a test to ensure that it works
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaragon committed Aug 9, 2018
1 parent 2b15ba1 commit 71f449d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/metrics_registry_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ TEST_CASE("Registry retrieving path with wrong type and different tags", "[metri
REQUIRE_THROWS_AS(subject.counter<short>("MyCounter", {{"mytag", "tagvalue"}}), metric_type_mismatch);
}

TEST_CASE("Registry store existing path with wrong type throws", "[metrics_registry]")
{
metrics_registry<> subject;
subject.counter("MyCounter");
auto ewma = subject.ewma<1_min>("MyEwma");
REQUIRE_THROWS_AS(subject.register_existing("MyCounter", ewma, {{"mytag", "tagvalue"}}), metric_type_mismatch);
}

TEST_CASE("Registry visitor visits counters", "[metrics_registry]")
{
int names = 0;
Expand Down

0 comments on commit 71f449d

Please sign in to comment.