wallet/testbed.cpp
2022-05-23 16:06:01 +10:00

54 lines
2.0 KiB
C++

#include "stdafx.h"
//#include <mbctype.h>
/* Any code here can be deleted at will without impact on the
functioning of the program.
This routine gets called during every unit test, and can log its results
to the log window. It should normally do absolutely nothing,
because useful working code should be moved the appropriate
files, and broken code should be thrown away
Anything here is a residue of forgotten experiments, and can safely
be thrown away. If any experiments have value, they will be
have been recorded in git. Nothing here is needed. If it was
needed, would have been moved.
Namespace testbed is only defined in this cpp file, hence nothing within
this namespace can be accessed from anywhere else.
except the routine testbed
If it needs to interact with the outside world, should post a message
analogously to queue_error_message, which then calls back to a
routine in this file.*/
namespace testbed {
using ristretto255::hash, ristretto255::hsh, ristretto255::scalar,
ristretto255::point, ro::serialize, ro::bin2hex, ro::hex2bin,
ro::bin2hex, ro::fasthash,ro::CompileSizedString ;
/* experimental code called during unit test
Anything here is a residue of forgotten experiments,
and can safely be thrown away
This is a playground, where you can do stuff without worrying you might
inadvertently break something that matters
No mechanism for input is available. You generally do not need it because you
hard code the testing data, and detect errors with asserts, rather than exceptions
but, of course, it can post a dialog using postmessage, then immediately return
and the dialog can then call anything.
Uncaught exceptions result in unit test failure, but not in an error
message in the main program UI.
If using a dialog, exceptions within the dialog will result in an error message in the
main program UI, rather than in the unit test result, since the unit test
is over before the dialog runs.
*/
void testbed() {
// queue_error_message("hello world");
}
}