aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-11-03 09:22:38 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-11-03 09:23:17 +0100
commit2a6972133f07382d13e08edc9c2e6c231689b2db (patch)
tree70dd887ead3967e1da0da825f3cb2af179ed1222 /src
parent7a9356bf16d3e21b99ce6badc88f949679f8e846 (diff)
parent2191eac812a72fe57167be882bddd2e6a3f0340e (diff)
Merge pull request #5185
2191eac add tests to travis (Cory Fields) 7667850 tests: replace the old (unused since Travis) tests with new rpc test scripts (Cory Fields) fa7f8cd tests: remove old pull-tester scripts (Cory Fields) 5122ea7 tests: fix forknotify.py on windows (Cory Fields) 7a41614 tests: allow rpc-tests to get filenames for bitcoind and bitcoin-cli from the environment (Cory Fields) f635269 tests: enable alertnotify test for Windows (Cory Fields)
Diffstat (limited to 'src')
-rw-r--r--src/test/alert_tests.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp
index 9cf7a98f46..4869ba52ac 100644
--- a/src/test/alert_tests.cpp
+++ b/src/test/alert_tests.cpp
@@ -154,9 +154,6 @@ BOOST_AUTO_TEST_CASE(AlertApplies)
}
-// This uses sh 'echo' to test the -alertnotify function, writing to a
-// /tmp file. So skip it on Windows:
-#ifndef WIN32
BOOST_AUTO_TEST_CASE(AlertNotify)
{
SetMockTime(11);
@@ -171,15 +168,24 @@ BOOST_AUTO_TEST_CASE(AlertNotify)
std::vector<std::string> r = read_lines(temp);
BOOST_CHECK_EQUAL(r.size(), 4u);
+
+// Windows built-in echo semantics are different than posixy shells. Quotes and
+// whitespace are printed literally.
+
+#ifndef WIN32
BOOST_CHECK_EQUAL(r[0], "Alert 1");
BOOST_CHECK_EQUAL(r[1], "Alert 2, cancels 1");
BOOST_CHECK_EQUAL(r[2], "Alert 2, cancels 1");
BOOST_CHECK_EQUAL(r[3], "Evil Alert; /bin/ls; echo "); // single-quotes should be removed
-
+#else
+ BOOST_CHECK_EQUAL(r[0], "'Alert 1' ");
+ BOOST_CHECK_EQUAL(r[1], "'Alert 2, cancels 1' ");
+ BOOST_CHECK_EQUAL(r[2], "'Alert 2, cancels 1' ");
+ BOOST_CHECK_EQUAL(r[3], "'Evil Alert; /bin/ls; echo ' ");
+#endif
boost::filesystem::remove(temp);
SetMockTime(0);
}
-#endif
BOOST_AUTO_TEST_SUITE_END()