2018-11-04 15:17:22 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* unittests/libretroshare/gxs/nxs_test/rsgxsnetservice_test.cc *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2012, Crispy <retroshare.team@gmailcom> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
******************************************************************************/
|
2014-04-05 03:27:18 -04:00
|
|
|
|
2014-04-13 17:52:53 -04:00
|
|
|
#include <gtest/gtest.h>
|
2014-04-05 03:27:18 -04:00
|
|
|
|
2014-04-13 17:52:53 -04:00
|
|
|
#include "nxsgrpsync_test.h"
|
2014-04-26 06:07:25 -04:00
|
|
|
#include "nxsmsgsync_test.h"
|
2014-04-13 17:52:53 -04:00
|
|
|
#include "nxstesthub.h"
|
2014-05-27 17:14:05 -04:00
|
|
|
#include "nxsgrpsyncdelayed.h"
|
2014-04-05 03:27:18 -04:00
|
|
|
|
2016-02-14 04:21:48 -05:00
|
|
|
// disabled, because it fails after rebase to current master (did not fail in 2015, fails in 2016)
|
|
|
|
TEST(libretroshare_gxs, DISABLED_gxs_grp_sync)
|
2014-04-05 03:27:18 -04:00
|
|
|
{
|
2017-07-24 18:07:53 -04:00
|
|
|
rs_nxs_test::NxsTestScenario *gsync_test = new rs_nxs_test::NxsGrpSync();
|
2014-04-13 17:52:53 -04:00
|
|
|
rs_nxs_test::NxsTestHub tHub(gsync_test);
|
|
|
|
tHub.StartTest();
|
2014-04-18 17:58:14 -04:00
|
|
|
|
2015-12-24 05:58:57 -05:00
|
|
|
// wait xx secs, because sync happens every 60sec
|
|
|
|
rs_nxs_test::NxsTestHub::Wait(1.5*60);
|
2014-04-26 06:07:25 -04:00
|
|
|
|
|
|
|
tHub.EndTest();
|
|
|
|
|
|
|
|
ASSERT_TRUE(tHub.testsPassed());
|
2014-05-18 12:44:19 -04:00
|
|
|
|
2014-05-27 17:14:05 -04:00
|
|
|
tHub.CleanUpTest();
|
2017-07-24 18:07:53 -04:00
|
|
|
delete gsync_test ;
|
2014-05-27 17:14:05 -04:00
|
|
|
}
|
|
|
|
|
2016-02-14 04:21:48 -05:00
|
|
|
// disabled, not implemented (does currently the same as NxsGrpSync)
|
|
|
|
TEST(libretroshare_gxs, DISABLED_gxs_grp_sync_delayed)
|
2014-05-27 17:14:05 -04:00
|
|
|
{
|
2017-07-24 18:07:53 -04:00
|
|
|
rs_nxs_test::NxsTestScenario *gsync_test = new rs_nxs_test::NxsGrpSyncDelayed();
|
2014-05-27 17:14:05 -04:00
|
|
|
rs_nxs_test::NxsTestHub tHub(gsync_test);
|
|
|
|
tHub.StartTest();
|
|
|
|
|
2015-12-24 05:58:57 -05:00
|
|
|
// wait xx secs, because sync happens every 60sec
|
|
|
|
rs_nxs_test::NxsTestHub::Wait(2.5*60);
|
2014-05-27 17:14:05 -04:00
|
|
|
|
|
|
|
tHub.EndTest();
|
|
|
|
|
|
|
|
ASSERT_TRUE(tHub.testsPassed());
|
|
|
|
|
|
|
|
tHub.CleanUpTest();
|
|
|
|
|
2017-07-24 18:07:53 -04:00
|
|
|
delete gsync_test ;
|
2014-04-26 06:07:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(libretroshare_gxs, gxs_msg_sync)
|
|
|
|
{
|
2017-07-24 18:07:53 -04:00
|
|
|
rs_nxs_test::NxsTestScenario *gsync_test = new rs_nxs_test::NxsMsgSync();
|
2014-04-26 06:07:25 -04:00
|
|
|
rs_nxs_test::NxsTestHub tHub(gsync_test);
|
|
|
|
tHub.StartTest();
|
|
|
|
|
|
|
|
// wait for ten seconds
|
|
|
|
rs_nxs_test::NxsTestHub::Wait(10);
|
2014-04-18 17:58:14 -04:00
|
|
|
|
2014-04-13 17:52:53 -04:00
|
|
|
tHub.EndTest();
|
2014-04-05 03:27:18 -04:00
|
|
|
|
2014-04-13 17:52:53 -04:00
|
|
|
ASSERT_TRUE(tHub.testsPassed());
|
2014-05-27 17:14:05 -04:00
|
|
|
|
|
|
|
tHub.CleanUpTest();
|
2017-07-24 18:07:53 -04:00
|
|
|
delete gsync_test ;
|
2014-04-05 03:27:18 -04:00
|
|
|
}
|
2014-05-27 17:14:05 -04:00
|
|
|
|
|
|
|
TEST(libretroshare_gxs, gxs_msg_sync_delayed)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|