Skip to content

Commit

Permalink
Improve Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vvromanov committed Dec 8, 2024
1 parent 4f51c2d commit 2605a19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/HistoryCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ HistoryCounterData *HistoryCounters::GetCounterPtr(const char *name) {
}

HistoryCounters::index_t HistoryCounters::GetCounterIndex(const char *name) {
{
READ_LOCK;
auto index = GetData()->dict.Lookup(name);
if (index != DICTIONARY_INVALID_INDEX) {
return index;
}
}
WRITE_LOCK;
auto index = GetData()->dict.Lookup(name);
if (index != DICTIONARY_INVALID_INDEX) {
Expand Down
3 changes: 2 additions & 1 deletion tests/TestHistoryCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TEST_F(TestHistoryCounters, GetIndex) {
char cn[100];
snprintf(cn, sizeof(cn), TEST_COUNTER ".%05d", i);
EXPECT_EQ(i, GetHistoryCounters().GetCounterIndex(cn));
EXPECT_EQ(i, GetHistoryCounters().GetCounterIndex(cn));
}
EXPECT_EQ(DICTIONARY_INVALID_INDEX, GetHistoryCounters().GetCounterIndex("xxx"));
}
Expand Down Expand Up @@ -91,7 +92,7 @@ TEST_F(TestHistoryCounters, DumpRaw) {
));
EXPECT_TRUE(HC_TestDump(format_raw,
"",
"XXX"
"test.level1.level2"
));
}

Expand Down

0 comments on commit 2605a19

Please sign in to comment.