aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test/wallettests.cpp
AgeCommit message (Collapse)Author
2017-06-01Fix bumpfee test after #10449Russell Yanofsky
Failure reported by Jorge Timón <jtimon@jtimon.cc> https://github.com/bitcoin/bitcoin/pull/10449#issuecomment-305556569
2017-05-25Fix broken q4 test buildRussell Yanofsky
Error reported by Patrick Strateman <patrick.strateman@gmail.com> https://github.com/bitcoin/bitcoin/pull/10420#issuecomment-303908782
2017-05-23Add Qt tests for wallet spends & bumpfeeRussell Yanofsky
A few code changes were needed to accompany the test: * Adding setObjectName() calls for a few Qt controls to make them easily accessible from the test. * Calling contextMenu->popup() instead of contextMenu->exec() to open the transaction list context menu without blocking the test thread. * Opening the context menu at the contextualMenu event point rather than the cursor position (this change was not strictly needed to make the test work, but is more correct). * Updating the bumped transaction row with showTransaction=true instead of false. This is needed to prevent the bumped tx from being hidden, so the last part of the test which attempts to bump the bumped tx can work. (Technically this change is a more general bugfix not limited to the testing environment, but the bug doesn't happen outside of the testing environment because in the full Qt client, a queued NotifyTransactionChanged notification causes the row to be updated twice, first with showTransaction=false, then immediately after with showTransaction=true.)
2017-05-17[test] Move some tests from qt -> walletRussell Yanofsky
After previous refactoring, the tests make more sense here.
2017-05-17[test] Add tests for some walletmodel functionsRussell Yanofsky
Add unit tests for some walletmodel functions that will be refactored & moved in the next commit.
2017-04-20wallet: Introduce database handle wrapperWladimir J. van der Laan
Abstract database handle from explicit strFilename into CWalletDBWrapper. Also move CWallet::Backup to db.cpp - as it deals with representation details this is a database specific operation.
2017-04-03Run bitcoin_test-qt under minimal QPA platformRussell Yanofsky
Fixes broken "make check" reported by Matt Corallo <git@bluematt.me> in https://github.com/bitcoin/bitcoin/issues/10110 Fix was suggested and initially implemented by Cory Fields <cory-nospam-@coryfields.com> in https://github.com/bitcoin/bitcoin/pull/10117#issuecomment-290275236
2017-03-27Make qt wallet test compatible with qt4Russell Yanofsky
Unlike Qt5, the Qt4 signals implementation doesn't allow a signal to be directly connected to a c++ lambda expression. Work around this by defining a Callback QObject with a virtual method that can forward calls to a closure. The Qt4 error was reported by Patrick Strateman <patrick.strateman@gmail.com> in https://github.com/bitcoin/bitcoin/pull/10039#issuecomment-289248763
2017-03-20Avoid QTimer::singleShot compile error with Qt 5.3.2Russell Yanofsky
Construct QTimer object directly, instead of relying on QTimer::singleShot overloads accepting lambdas, which weren't introduced until Qt 5.4. Avoids the following compile error in debian jessie: ``` qt/test/wallettests.cpp: In function ‘void {anonymous}::ConfirmSend()’: qt/test/wallettests.cpp:34:6: error: no matching function for call to ‘QTimer::singleShot(int, Qt::TimerType, {anonymous}::ConfirmSend()::<lambda()>)’ }); ^ qt/test/wallettests.cpp:34:6: note: candidates are: In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QTimer:1:0, from ./qt/sendcoinsdialog.h:13, from qt/test/wallettests.cpp:7: /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:81:17: note: static void QTimer::singleShot(int, const QObject*, const char*) static void singleShot(int msec, const QObject *receiver, const char *member); ^ /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:81:17: note: no known conversion for argument 2 from ‘Qt::TimerType’ to ‘const QObject*’ /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:82:17: note: static void QTimer::singleShot(int, Qt::TimerType, const QObject*, const char*) static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member); ^ /usr/include/x86_64-linux-gnu/qt5/QtCore/qtimer.h:82:17: note: candidate expects 4 arguments, 3 provided ``` Error reported by Pavel Janík <Pavel@Janik.cz> in https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287574436
2017-03-20Avoid scoped_connection compile error with boost 1.55.0Russell Yanofsky
Construct scoped_connection directly instead of relying on copy initialization and move constructor. Avoids the following compile error in debian jessie: ``` In file included from /usr/include/boost/signals2/signal.hpp:21:0, from ./util.h:29, from ./dbwrapper.h:11, from ./txdb.h:10, from ./test/test_bitcoin.h:11, from qt/test/wallettests.cpp:11: /usr/include/boost/signals2/connection.hpp: In function ‘uint256 {anonymous}::SendCoins(CWallet&, SendCoinsDialog&, const CBitcoinAddress&, CAmount)’: /usr/include/boost/signals2/connection.hpp:234:7: error: ‘boost::signals2::scoped_connection::scoped_connection(const boost::signals2::scoped_connection&)’ is private scoped_connection(const scoped_connection &other); ^ qt/test/wallettests.cpp:47:6: error: within this context }); ^ ``` Error reported by Pavel Janík <Pavel@Janik.cz> in https://github.com/bitcoin/bitcoin/pull/9974#issuecomment-287550034
2017-03-15Add simple qt wallet test sending a transactionRussell Yanofsky