DDraceNetwork Docs
score.cpp File Reference
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <base/detect.h>
#include <engine/server/databases/connection.h>
#include <engine/server/databases/connection_pool.h>
#include <engine/shared/config.h>
#include <game/server/scoreworker.h>
#include <sqlite3.h>
Include dependency graph for score.cpp:

Classes

struct  Score
 
struct  SingleScore
 
struct  TeamScore
 
struct  MapInfo
 
struct  MapVote
 
struct  Points
 
struct  RandomMap
 

Macros

#define INSTANTIATE(SUITE)
 

Functions

 TEST (SQLite, Version)
 
 TEST_P (SingleScore, TopRegional)
 
 TEST_P (SingleScore, Top)
 
 TEST_P (SingleScore, RankRegional)
 
 TEST_P (SingleScore, Rank)
 
 TEST_P (SingleScore, TopServerRegional)
 
 TEST_P (SingleScore, TopServer)
 
 TEST_P (SingleScore, RankServerRegional)
 
 TEST_P (SingleScore, RankServer)
 
 TEST_P (SingleScore, LoadPlayerData)
 
 TEST_P (SingleScore, TimesExists)
 
 TEST_P (SingleScore, TimesDoesntExist)
 
 TEST_P (TeamScore, All)
 
 TEST_P (TeamScore, TeamTop5Regional)
 
 TEST_P (TeamScore, PlayerExists)
 
 TEST_P (TeamScore, PlayerDoesntExist)
 
 TEST_P (TeamScore, RankUpdates)
 
 TEST_P (MapInfo, ExactNoFinish)
 
 TEST_P (MapInfo, ExactFinish)
 
 TEST_P (MapInfo, Fuzzy)
 
 TEST_P (MapInfo, DoesntExit)
 
 TEST_P (MapVote, Exact)
 
 TEST_P (MapVote, Fuzzy)
 
 TEST_P (MapVote, DoesntExist)
 
 TEST_P (Points, NoPoints)
 
 TEST_P (Points, NoPointsTop)
 
 TEST_P (Points, OnePoints)
 
 TEST_P (Points, OnePointsTop)
 
 TEST_P (Points, TwoPoints)
 
 TEST_P (Points, TwoPointsTop)
 
 TEST_P (Points, EqualPoints)
 
 TEST_P (Points, EqualPointsTop)
 
 TEST_P (RandomMap, NoStars)
 
 TEST_P (RandomMap, StarsExists)
 
 TEST_P (RandomMap, StarsDoesntExist)
 
 TEST_P (RandomMap, UnfinishedExists)
 
 TEST_P (RandomMap, UnfinishedDoesntExist)
 
 INSTANTIATE_TEST_SUITE_P (Sql, SingleScore, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 
 INSTANTIATE_TEST_SUITE_P (Sql, TeamScore, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 
 INSTANTIATE_TEST_SUITE_P (Sql, MapInfo, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 
 INSTANTIATE_TEST_SUITE_P (Sql, MapVote, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 
 INSTANTIATE_TEST_SUITE_P (Sql, Points, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 
 INSTANTIATE_TEST_SUITE_P (Sql, RandomMap, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
 

Variables

auto g_pSqliteConn = CreateSqliteConnection(":memory:", true)
 
auto g_TestValues
 

Macro Definition Documentation

◆ INSTANTIATE

#define INSTANTIATE (   SUITE)
Value:
[](const testing::TestParamInfo<Score::ParamType> &Info) { \
switch(Info.index) \
{ \
case 0: return "SQLite"; \
case 1: return "MySQL"; \
default: return "Unknown"; \
} \
})
INSTANTIATE_TEST_SUITE_P(Sql, SingleScore, g_TestValues, [](const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} })
auto g_TestValues
Definition: score.cpp:619

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P() [1/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
MapInfo  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ INSTANTIATE_TEST_SUITE_P() [2/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
MapVote  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ INSTANTIATE_TEST_SUITE_P() [3/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
Points  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ INSTANTIATE_TEST_SUITE_P() [4/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
RandomMap  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ INSTANTIATE_TEST_SUITE_P() [5/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
SingleScore  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ INSTANTIATE_TEST_SUITE_P() [6/6]

INSTANTIATE_TEST_SUITE_P ( Sql  ,
TeamScore  ,
g_TestValues  ,
[] (const testing::TestParamInfo< Score::ParamType > &Info) { switch(Info.index) { case 0:return "SQLite";case 1:return "MySQL";default:return "Unknown";} }   
)

◆ TEST()

TEST ( SQLite  ,
Version   
)

◆ TEST_P() [1/36]

TEST_P ( MapInfo  ,
DoesntExit   
)

◆ TEST_P() [2/36]

TEST_P ( MapInfo  ,
ExactFinish   
)

◆ TEST_P() [3/36]

TEST_P ( MapInfo  ,
ExactNoFinish   
)

◆ TEST_P() [4/36]

TEST_P ( MapInfo  ,
Fuzzy   
)

◆ TEST_P() [5/36]

TEST_P ( MapVote  ,
DoesntExist   
)

◆ TEST_P() [6/36]

TEST_P ( MapVote  ,
Exact   
)

◆ TEST_P() [7/36]

TEST_P ( MapVote  ,
Fuzzy   
)

◆ TEST_P() [8/36]

TEST_P ( Points  ,
EqualPoints   
)

◆ TEST_P() [9/36]

TEST_P ( Points  ,
EqualPointsTop   
)

◆ TEST_P() [10/36]

TEST_P ( Points  ,
NoPoints   
)

◆ TEST_P() [11/36]

TEST_P ( Points  ,
NoPointsTop   
)

◆ TEST_P() [12/36]

TEST_P ( Points  ,
OnePoints   
)

◆ TEST_P() [13/36]

TEST_P ( Points  ,
OnePointsTop   
)

◆ TEST_P() [14/36]

TEST_P ( Points  ,
TwoPoints   
)

◆ TEST_P() [15/36]

TEST_P ( Points  ,
TwoPointsTop   
)

◆ TEST_P() [16/36]

TEST_P ( RandomMap  ,
NoStars   
)

◆ TEST_P() [17/36]

TEST_P ( RandomMap  ,
StarsDoesntExist   
)

◆ TEST_P() [18/36]

TEST_P ( RandomMap  ,
StarsExists   
)

◆ TEST_P() [19/36]

TEST_P ( RandomMap  ,
UnfinishedDoesntExist   
)

◆ TEST_P() [20/36]

TEST_P ( RandomMap  ,
UnfinishedExists   
)

◆ TEST_P() [21/36]

TEST_P ( SingleScore  ,
LoadPlayerData   
)

◆ TEST_P() [22/36]

TEST_P ( SingleScore  ,
Rank   
)

◆ TEST_P() [23/36]

TEST_P ( SingleScore  ,
RankRegional   
)

◆ TEST_P() [24/36]

TEST_P ( SingleScore  ,
RankServer   
)

◆ TEST_P() [25/36]

TEST_P ( SingleScore  ,
RankServerRegional   
)

◆ TEST_P() [26/36]

TEST_P ( SingleScore  ,
TimesDoesntExist   
)

◆ TEST_P() [27/36]

TEST_P ( SingleScore  ,
TimesExists   
)

◆ TEST_P() [28/36]

TEST_P ( SingleScore  ,
Top   
)

◆ TEST_P() [29/36]

TEST_P ( SingleScore  ,
TopRegional   
)

◆ TEST_P() [30/36]

TEST_P ( SingleScore  ,
TopServer   
)

◆ TEST_P() [31/36]

TEST_P ( SingleScore  ,
TopServerRegional   
)

◆ TEST_P() [32/36]

TEST_P ( TeamScore  ,
All   
)

◆ TEST_P() [33/36]

TEST_P ( TeamScore  ,
PlayerDoesntExist   
)

◆ TEST_P() [34/36]

TEST_P ( TeamScore  ,
PlayerExists   
)

◆ TEST_P() [35/36]

TEST_P ( TeamScore  ,
RankUpdates   
)

◆ TEST_P() [36/36]

TEST_P ( TeamScore  ,
TeamTop5Regional   
)

Variable Documentation

◆ g_pSqliteConn

auto g_pSqliteConn = CreateSqliteConnection(":memory:", true)

◆ g_TestValues

auto g_TestValues
Initial value:
{
testing::Values(
}
auto g_pSqliteConn
Definition: score.cpp:603