Skip to content

Commit

Permalink
fix: benchmarks segfaulting
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Aug 24, 2024
1 parent 9f588b7 commit 8cf0eb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
- Dev: Refactored a few `#define`s into `const(expr)` and cleaned includes. (#5527)
- Dev: Added `FlagsEnum::isEmpty`. (#5550)
- Dev: Prepared for Qt 6.8 by addressing some deprecations. (#5529)
- Dev: Fixed benchmarks segfaulting on run. (#5559)
- Dev: Refactored `MessageBuilder` to be a single class. (#5548)
- Dev: Recent changes are now shown in the nightly release description. (#5553, #5554)

Expand Down
7 changes: 7 additions & 0 deletions benchmarks/src/Highlights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "mocks/BaseApplication.hpp"
#include "mocks/UserData.hpp"
#include "util/Helpers.hpp"

#include <benchmark/benchmark.h>
Expand Down Expand Up @@ -64,8 +65,14 @@ class MockApplication : public mock::BaseApplication
return &this->highlights;
}

IUserDataController *getUserData() override
{
return &this->userData;
}

AccountController accounts;
HighlightController highlights;
mock::UserDataController userData;
};

static void BM_HighlightTest(benchmark::State &state)
Expand Down

0 comments on commit 8cf0eb3

Please sign in to comment.