refactor: some Application & style things (#5561)
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
TEST(ChatterSet, insert)
|
||||
{
|
||||
chatterino::ChatterSet set;
|
||||
ChatterSet set;
|
||||
|
||||
EXPECT_FALSE(set.contains("pajlada"));
|
||||
EXPECT_FALSE(set.contains("Pajlada"));
|
||||
@@ -26,7 +28,7 @@ TEST(ChatterSet, insert)
|
||||
|
||||
TEST(ChatterSet, MaxSize)
|
||||
{
|
||||
chatterino::ChatterSet set;
|
||||
ChatterSet set;
|
||||
|
||||
EXPECT_FALSE(set.contains("pajlada"));
|
||||
EXPECT_FALSE(set.contains("Pajlada"));
|
||||
@@ -36,7 +38,7 @@ TEST(ChatterSet, MaxSize)
|
||||
EXPECT_TRUE(set.contains("Pajlada"));
|
||||
|
||||
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
||||
for (auto i = 0; i < chatterino::ChatterSet::chatterLimit - 1; ++i)
|
||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||
{
|
||||
set.addRecentChatter(QString("%1").arg(i));
|
||||
}
|
||||
@@ -53,7 +55,7 @@ TEST(ChatterSet, MaxSize)
|
||||
|
||||
TEST(ChatterSet, MaxSizeLastUsed)
|
||||
{
|
||||
chatterino::ChatterSet set;
|
||||
ChatterSet set;
|
||||
|
||||
EXPECT_FALSE(set.contains("pajlada"));
|
||||
EXPECT_FALSE(set.contains("Pajlada"));
|
||||
@@ -63,7 +65,7 @@ TEST(ChatterSet, MaxSizeLastUsed)
|
||||
EXPECT_TRUE(set.contains("Pajlada"));
|
||||
|
||||
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
||||
for (auto i = 0; i < chatterino::ChatterSet::chatterLimit - 1; ++i)
|
||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||
{
|
||||
set.addRecentChatter(QString("%1").arg(i));
|
||||
}
|
||||
@@ -75,7 +77,7 @@ TEST(ChatterSet, MaxSizeLastUsed)
|
||||
set.addRecentChatter("pajlada");
|
||||
|
||||
// After another CHATTER_LIMIT-1 additional chatters, pajlada should still be there
|
||||
for (auto i = 0; i < chatterino::ChatterSet::chatterLimit - 1; ++i)
|
||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||
{
|
||||
set.addRecentChatter(QString("new-%1").arg(i));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
|
||||
using namespace chatterino;
|
||||
using namespace std::chrono_literals;
|
||||
@@ -33,6 +32,8 @@ using namespace std::chrono_literals;
|
||||
|
||||
#ifdef RUN_PUBSUB_TESTS
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
template <typename T>
|
||||
class ReceivedMessage
|
||||
{
|
||||
@@ -451,4 +452,6 @@ TEST(TwitchPubSubClient, AutoModMessageHeld)
|
||||
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user