darkcoinproject/darkcoin — pull request #24 by DeathRay1977 (2014-07-10 08:06:50+00:00)
Title: Fixes for Alerts Unit Tests

This pull request fixes the Unit Tests held in alert_tests.cpp. A key pair has been created specifically for unit testing. The private key is referenced in alert_tests.cpp and the accompanying public key has been added to alert.cpp but guarded by a #ifdef UNIT_TEST preprocessor statement so it will not be used by production or testnet. This new key pair is used to sign/verify the Unit Test alerts. This does not affect the production/testnet system which will carry on using the old Private Keys owned by Evan. There is no need to regenerate the alertTests file using the production private key. In fact this file is now redundant and has been removed. It was an overhead to generate the signed alerts, write them to disk and then read them back straight away. The code now signs the alerts and stores them directly into a vector to be used in the Unit tests.

To build the test_darkcoin executable, you will now need to pass that define in the make command e.g.

make -f makefile.unix test_darkcoin UNIT_TEST=1

All Unit Tests for alerts now pass without any errors. Code has been tested on both OSX and Linux.