mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:30:04 +00:00
Add warnings provider to settings
This commit is contained in:
parent
ea19de3e5f
commit
5ee2d10a1b
8 changed files with 234 additions and 144 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit ab32df5b0731d70aa5b977453c9aa4786eb0bd3f
|
||||
Subproject commit e350743fd8ca6858ce49a22bb8e40a0c6710ca86
|
||||
|
|
@ -8,12 +8,18 @@ namespace network
|
|||
{
|
||||
|
||||
static const std::string& kDefaultUrl {"https://warnings.allisonhouse.com"};
|
||||
static const std::string& kAlternateUrl {"http://warnings.cod.edu"};
|
||||
static const std::string& kAlternateUrl {"https://warnings.cod.edu"};
|
||||
|
||||
TEST(DirList, GetDefaultUrl)
|
||||
{
|
||||
auto records = DirList(kDefaultUrl);
|
||||
|
||||
// No records, skip test
|
||||
if (records.size() == 0)
|
||||
{
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
EXPECT_GT(records.size(), 0);
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +27,12 @@ TEST(DirList, GetAlternateUrl)
|
|||
{
|
||||
auto records = DirList(kAlternateUrl);
|
||||
|
||||
// No records, skip test
|
||||
if (records.size() == 0)
|
||||
{
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
EXPECT_GT(records.size(), 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace provider
|
|||
{
|
||||
|
||||
static const std::string& kDefaultUrl {"https://warnings.allisonhouse.com"};
|
||||
static const std::string& kAlternateUrl {"http://warnings.cod.edu"};
|
||||
static const std::string& kAlternateUrl {"https://warnings.cod.edu"};
|
||||
|
||||
class WarningsProviderTest : public testing::TestWithParam<std::string>
|
||||
{
|
||||
|
|
@ -19,6 +19,12 @@ TEST_P(WarningsProviderTest, ListFiles)
|
|||
|
||||
auto [newObjects, totalObjects] = provider.ListFiles();
|
||||
|
||||
// No objects, skip test
|
||||
if (totalObjects == 0)
|
||||
{
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
EXPECT_GT(newObjects, 0);
|
||||
EXPECT_GT(totalObjects, 0);
|
||||
EXPECT_EQ(newObjects, totalObjects);
|
||||
|
|
@ -31,6 +37,12 @@ TEST_P(WarningsProviderTest, LoadUpdatedFiles)
|
|||
auto [newObjects, totalObjects] = provider.ListFiles();
|
||||
auto updatedFiles = provider.LoadUpdatedFiles();
|
||||
|
||||
// No objects, skip test
|
||||
if (totalObjects == 0)
|
||||
{
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
EXPECT_GT(newObjects, 0);
|
||||
EXPECT_GT(totalObjects, 0);
|
||||
EXPECT_EQ(newObjects, totalObjects);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue