Skip to content

Commit

Permalink
Locked status only updates after processing events.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Mar 19, 2016
1 parent fe5c24a commit 8528c94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rai/qt_test/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ TEST (wallet, select_account)
{
rai::system system (24000, 1);
auto wallet_l (system.nodes [0]->wallets.create (rai::uint256_union ()));
rai::public_key key1 (wallet_l->insert_adhoc (rai::keypair ().prv));
rai::public_key key2 (wallet_l->insert_adhoc (rai::keypair ().prv));
rai::public_key key1 (wallet_l->deterministic_insert ());
rai::public_key key2 (wallet_l->deterministic_insert ());
rai_qt::wallet wallet (*test_application, *system.nodes [0], wallet_l, key1);
ASSERT_EQ (key1, wallet.account);
QTest::mouseClick (wallet.show_advanced, Qt::LeftButton);
Expand Down Expand Up @@ -195,6 +195,7 @@ TEST (wallet, enter_password)
ASSERT_NE (-1, wallet.settings.lock_layout->indexOf (wallet.settings.lock));
ASSERT_NE (-1, wallet.settings.layout->indexOf (wallet.settings.back));
QTest::mouseClick (wallet.settings.unlock, Qt::LeftButton);
test_application->processEvents();
ASSERT_EQ ("Status: Wallet password empty", wallet.status->text ());
{
rai::transaction transaction (system.nodes [0]->store.environment, nullptr, true);
Expand All @@ -203,10 +204,12 @@ TEST (wallet, enter_password)
QTest::mouseClick (wallet.settings_button, Qt::LeftButton);
QTest::keyClicks (wallet.settings.new_password, "a");
QTest::mouseClick (wallet.settings.unlock, Qt::LeftButton);
test_application->processEvents();
ASSERT_EQ ("Status: Wallet locked", wallet.status->text ());
wallet.settings.new_password->setText ("");
QTest::keyClicks (wallet.settings.password, "abc");
QTest::mouseClick (wallet.settings.unlock, Qt::LeftButton);
test_application->processEvents();
auto status (wallet.status->text ());
ASSERT_EQ ("Status: Running", status);
ASSERT_EQ ("", wallet.settings.password->text ());
Expand Down

0 comments on commit 8528c94

Please sign in to comment.