Adding slow tests project.

Removing unused database.
This commit is contained in:
clemahieu 2014-12-06 14:02:46 -06:00
commit b93fabe8a9
5 changed files with 46 additions and 50 deletions

View file

@ -61,6 +61,9 @@ add_executable (core_test
rai/core_test/uint256_union.cpp
rai/core_test/wallet_test.cpp
)
add_executable (slow_test
rai/slow_test/client.cpp)
add_executable (qt_test
rai/qt_test/qt.cpp)
@ -86,7 +89,7 @@ add_executable (qt_system
SET (ACTIVE_NETWORK rai_active_network CACHE STRING "Selects which network parameters are used")
set_property (CACHE ACTIVE_NETWORK PROPERTY STRINGS rai_test_network rai_beta_network rai_live_network)
set_target_properties (secure core core_test qt_test cli qt qt_client qt_system landing PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror=switch ${PLATFORM_COMPILE_FLAGS} -DQT_NO_KEYWORDS -DACTIVE_NETWORK=${ACTIVE_NETWORK} -DED25519_CUSTOMHASH -DED25519_CUSTOMRNG")
set_target_properties (secure core core_test slow_test qt_test cli qt qt_client qt_system landing PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror=switch ${PLATFORM_COMPILE_FLAGS} -DQT_NO_KEYWORDS -DACTIVE_NETWORK=${ACTIVE_NETWORK} -DED25519_CUSTOMHASH -DED25519_CUSTOMRNG")
set_target_properties (qt_client qt_test PROPERTIES LINK_FLAGS "${PLATFORM_GUI_EXE_LINK_FLAGS}")
if (WIN32)
@ -97,6 +100,8 @@ endif (WIN32)
target_link_libraries (core_test core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY})
target_link_libraries (slow_test core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY})
target_link_libraries (cli core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY})
target_link_libraries (landing core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY})

View file

@ -630,35 +630,6 @@ TEST (system, generate_send_new)
}
}
TEST (system, generate_mass_activity)
{
rai::system system (24000, 1);
system.clients [0]->wallet.insert (rai::test_genesis_key.prv);
size_t count (20);
system.generate_mass_activity (count, *system.clients [0]);
size_t accounts (0);
for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i)
{
++accounts;
}
ASSERT_GT (accounts, count / 10);
}
TEST (system, DISABLED_generate_mass_activity_long)
{
rai::system system (24000, 1);
system.clients [0]->wallet.insert (rai::test_genesis_key.prv);
size_t count (10000);
system.generate_mass_activity (count, *system.clients [0]);
system.clients [0]->log.dump_cerr ();
size_t accounts (0);
for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i)
{
++accounts;
}
ASSERT_GT (accounts, count / 10);
}
TEST (ledger, representation)
{
leveldb::Status init;

View file

@ -1573,33 +1573,24 @@ rai::block_store::block_store (leveldb::Status & init_a, boost::filesystem::path
if (status4.ok ())
{
representation.reset (db);
auto status5 (leveldb::DB::Open (options, (path_a / "forks.ldb").string (), &db));
if (status5.ok ())
auto status6 (leveldb::DB::Open (options, (path_a / "bootstrap.ldb").string (), &db));
if (status6.ok ())
{
forks.reset (db);
auto status6 (leveldb::DB::Open (options, (path_a / "bootstrap.ldb").string (), &db));
if (status6.ok ())
bootstrap.reset (db);
auto status7 (leveldb::DB::Open (options, (path_a / "checksum.ldb").string (), &db));
if (status7.ok ())
{
bootstrap.reset (db);
auto status7 (leveldb::DB::Open (options, (path_a / "checksum.ldb").string (), &db));
if (status7.ok ())
{
checksum.reset (db);
checksum_put (0, 0, 0);
}
else
{
init_a = status7;
}
checksum.reset (db);
checksum_put (0, 0, 0);
}
else
{
init_a = status6;
init_a = status7;
}
}
else
{
init_a = status5;
init_a = status6;
}
}
else

View file

@ -460,8 +460,6 @@ namespace rai
std::unique_ptr <leveldb::DB> pending;
// account -> weight // Representation
std::unique_ptr <leveldb::DB> representation;
// block_hash -> sequence, block // Previous block hash to most recent sequence and fork proof
std::unique_ptr <leveldb::DB> forks;
// block_hash -> block // Unchecked bootstrap blocks
std::unique_ptr <leveldb::DB> bootstrap;
// block_hash -> block_hash // Tracking successors for bootstrapping

31
rai/slow_test/client.cpp Normal file
View file

@ -0,0 +1,31 @@
#include <gtest/gtest.h>
#include <rai/core/core.hpp>
TEST (system, generate_mass_activity)
{
rai::system system (24000, 1);
system.clients [0]->wallet.insert (rai::test_genesis_key.prv);
size_t count (20);
system.generate_mass_activity (count, *system.clients [0]);
size_t accounts (0);
for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i)
{
++accounts;
}
ASSERT_GT (accounts, count / 10);
}
TEST (system, generate_mass_activity_long)
{
rai::system system (24000, 1);
system.clients [0]->wallet.insert (rai::test_genesis_key.prv);
size_t count (10000);
system.generate_mass_activity (count, *system.clients [0]);
system.clients [0]->log.dump_cerr ();
size_t accounts (0);
for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i)
{
++accounts;
}
ASSERT_GT (accounts, count / 10);
}