Merge pull request #487 from langerhans/1.7-dev-alerttest

Fix doubled alerts in alert tests causing them to fail
This commit is contained in:
langerhans 2014-04-24 22:28:33 +02:00
commit 7f16738720
2 changed files with 82 additions and 79 deletions

View file

@ -28,6 +28,8 @@ how to create this data:
*/
#ifdef CREATE_ALERTS
struct CreateAlerts
{
void SignAndSave(CAlert alert, const std::string filename) {
//serialze alert message
CDataStream sMsg(SER_NETWORK, PROTOCOL_VERSION);
@ -63,7 +65,7 @@ void SignAndSave(CAlert alert, const std::string filename) {
//
// alertTests contains 7 alerts, generated with this code:
//
void CreateAlerts()
CreateAlerts()
{
std::string filename("src/test/alertTests.raw");
@ -116,15 +118,16 @@ void CreateAlerts()
alert.setSubVer.clear();
SignAndSave(alert, filename);
}
~CreateAlerts() { }
};
BOOST_GLOBAL_FIXTURE(CreateAlerts)
#endif
struct ReadAlerts
{
ReadAlerts()
{
#ifdef CREATE_ALERTS
CreateAlerts();
#endif
std::vector<unsigned char> vch(alert_tests::alertTests, alert_tests::alertTests + sizeof(alert_tests::alertTests));
CDataStream stream(vch, SER_DISK, CLIENT_VERSION);
try {

Binary file not shown.