From 8de583b0a157ef18eaa07b01981d5a952ce72afc Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 21 Sep 2015 17:17:30 -0400 Subject: [PATCH] Fix unit tests --- tests/common/database_fixture.cpp | 4 ++-- tests/common/database_fixture.hpp | 4 ++-- tests/tests/operation_tests.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index b7325a7f..e3c69605 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -413,7 +413,7 @@ const account_object& database_fixture::get_account( const string& name )const const asset_object& database_fixture::create_bitasset( const string& name, - account_id_type issuer /* = 1 */, + account_id_type issuer /* = GRAPHENE_WITNESS_ACCOUNT */, uint16_t market_fee_percent /* = 100 */ /* 1% */, uint16_t flags /* = charge_market_fee */ ) @@ -438,7 +438,7 @@ const asset_object& database_fixture::create_bitasset( const asset_object& database_fixture::create_prediction_market( const string& name, - account_id_type issuer /* = 1 */, + account_id_type issuer /* = GRAPHENE_WITNESS_ACCOUNT */, uint16_t market_fee_percent /* = 100 */ /* 1% */, uint16_t flags /* = charge_market_fee */ ) diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 5b00ec8f..dc5705db 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -210,11 +210,11 @@ struct database_fixture { const asset_object& get_asset( const string& symbol )const; const account_object& get_account( const string& name )const; const asset_object& create_bitasset(const string& name, - account_id_type issuer = account_id_type(1), + account_id_type issuer = GRAPHENE_WITNESS_ACCOUNT, uint16_t market_fee_percent = 100 /*1%*/, uint16_t flags = charge_market_fee); const asset_object& create_prediction_market(const string& name, - account_id_type issuer = account_id_type(1), + account_id_type issuer = GRAPHENE_WITNESS_ACCOUNT, uint16_t market_fee_percent = 100 /*1%*/, uint16_t flags = charge_market_fee); const asset_object& create_user_issued_asset( const string& name ); diff --git a/tests/tests/operation_tests.cpp b/tests/tests/operation_tests.cpp index 00eca382..225b0843 100644 --- a/tests/tests/operation_tests.cpp +++ b/tests/tests/operation_tests.cpp @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE( call_order_update_test ) { try { ACTORS((dan)(sam)); - const auto& bitusd = create_bitasset("BITUSD"); + const auto& bitusd = create_bitasset("BITUSD", sam.id); const auto& core = asset_id_type()(db); transfer(committee_account, dan_id, asset(10000000)); @@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE( margin_call_limit_test ) { try { ACTORS((buyer)(seller)(borrower)(borrower2)(feedproducer)); - const auto& bitusd = create_bitasset("BITUSD"); + const auto& bitusd = create_bitasset("BITUSD", feedproducer_id); const auto& core = asset_id_type()(db); int64_t init_balance(1000000); @@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE( black_swan ) { try { ACTORS((buyer)(seller)(borrower)(borrower2)(feedproducer)); - const auto& bitusd = create_bitasset("BITUSD"); + const auto& bitusd = create_bitasset("BITUSD", feedproducer_id); const auto& core = asset_id_type()(db); int64_t init_balance(1000000); @@ -1251,7 +1251,7 @@ BOOST_AUTO_TEST_CASE( reserve_asset_test ) try { ACTORS((alice)(bob)(sam)(judge)); - const auto& basset = create_bitasset("BITUSD"); + const auto& basset = create_bitasset("BITUSD", judge_id); const auto& uasset = create_user_issued_asset("TEST"); const auto& passet = create_prediction_market("PMARK", judge_id); const auto& casset = asset_id_type()(db); @@ -1336,7 +1336,7 @@ BOOST_AUTO_TEST_CASE( cover_with_collateral_test ) try { ACTORS((alice)(bob)(sam)); - const auto& bitusd = create_bitasset("BITUSD"); + const auto& bitusd = create_bitasset("BITUSD", sam_id); const auto& core = asset_id_type()(db); BOOST_TEST_MESSAGE( "Setting price feed to $0.02 / 100" );