Skip to content

Commit 9cb45d8

Browse files
committed
ci fixes
1 parent 62b1610 commit 9cb45d8

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

lib/errorlogger.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ class CPPCHECKLIB ErrorLogger {
326326
protected:
327327
virtual std::size_t getSourceCacheSize() const {
328328
return 4;
329-
};
329+
}
330330

331-
class SourceCacheEntry {
331+
class CPPCHECKLIB SourceCacheEntry {
332332
public:
333333
explicit SourceCacheEntry(const std::string &file, int prio);
334334

@@ -342,7 +342,7 @@ class CPPCHECKLIB ErrorLogger {
342342
private:
343343
std::ifstream mStream;
344344
std::string mLine;
345-
int mLinenr;
345+
int mLinenr{0};
346346
};
347347

348348
std::vector<std::shared_ptr<SourceCacheEntry>> mSourceCache;

test/testerrorlogger.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -872,18 +872,18 @@ class TestErrorLogger : public TestFixture {
872872
public:
873873
friend class TestErrorLogger;
874874

875-
virtual void reportOut(const std::string &outmsg, Color c)
875+
void reportOut(const std::string &outmsg, Color c) override
876876
{
877877
(void) outmsg;
878878
(void) c;
879879
}
880880

881-
virtual void reportErr(const ErrorMessage &msg)
881+
void reportErr(const ErrorMessage &msg) override
882882
{
883883
(void) msg.toString(false, "{code}", "{code}", getSourceLineCallback());
884884
}
885885

886-
virtual void reportMetric(const std::string &metric)
886+
void reportMetric(const std::string &metric) override
887887
{
888888
(void) metric;
889889
}
@@ -910,8 +910,8 @@ class TestErrorLogger : public TestFixture {
910910
void testCacheContent_(const char *testfile,
911911
int testline,
912912
const std::string &file,
913-
std::vector<std::string> &&callstackFiles,
914-
std::vector<TestSourceCacheLogger::Match> &&content)
913+
const std::vector<std::string> &callstackFiles,
914+
const std::vector<TestSourceCacheLogger::Match> &content)
915915
{
916916
const auto heapCompare = [](const std::shared_ptr<ErrorLogger::SourceCacheEntry> &lhs,
917917
const std::shared_ptr<ErrorLogger::SourceCacheEntry> &rhs)
@@ -920,8 +920,8 @@ class TestErrorLogger : public TestFixture {
920920
};
921921

922922
std::list<ErrorMessage::FileLocation> callstack;
923-
for (const auto &file : callstackFiles)
924-
callstack.emplace_back(file, 1, 1);
923+
for (const auto &filename : callstackFiles)
924+
callstack.emplace_back(filename, 1, 1);
925925

926926
const ErrorMessage msg(callstack,
927927
file,
@@ -935,10 +935,10 @@ class TestErrorLogger : public TestFixture {
935935
ASSERT_EQUALS(content.size(), copy.size());
936936

937937
std::make_heap(copy.begin(), copy.end(), heapCompare);
938-
for (const auto match : content) {
938+
for (const auto &match : content) {
939939
std::pop_heap(copy.begin(), copy.end(), heapCompare);
940-
ASSERT_EQUALS(match.file, copy.back()->file);
941-
ASSERT_EQUALS(match.prio, copy.back()->prio);
940+
ASSERT_EQUALS_LOC(match.file, copy.back()->file, testfile, testline);
941+
ASSERT_EQUALS_LOC(match.prio, copy.back()->prio, testfile, testline);
942942
copy.pop_back();
943943
}
944944
}

0 commit comments

Comments
 (0)