aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/Makefile.am4
-rw-r--r--src/test/alert_tests.cpp5
-rw-r--r--src/test/checkblock_tests.cpp2
-rw-r--r--src/test/script_tests.cpp2
4 files changed, 8 insertions, 5 deletions
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index 80571aa29..2995deff0 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -10,7 +10,7 @@ bin_PROGRAMS = test_bitcoin
TESTS = test_bitcoin
-TEST_DATA_DIR=$(top_srcdir)/src/test/data
+TEST_DATA_DIR=$(srcdir)/data
TEST_DATA_FILES= $(TEST_DATA_DIR)/script_valid.json \
$(TEST_DATA_DIR)/base58_keys_valid.json $(TEST_DATA_DIR)/sig_canonical.json \
@@ -22,7 +22,7 @@ TEST_DATA_FILES= $(TEST_DATA_DIR)/script_valid.json \
# test_bitcoin binary #
test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) \
- -DTEST_DATA_DIR=$(TEST_DATA_DIR)
+ -DTEST_DATA_DIR=$(abs_srcdir)/data
test_bitcoin_LDADD = $(LIBBITCOIN) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
test_bitcoin_SOURCES = accounting_tests.cpp alert_tests.cpp \
diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp
index f7a11376d..ed6dcd818 100644
--- a/src/test/alert_tests.cpp
+++ b/src/test/alert_tests.cpp
@@ -73,7 +73,7 @@ struct ReadAlerts
{
std::string filename("alertTests");
namespace fs = boost::filesystem;
- fs::path testFile = fs::current_path() / "test" / "data" / filename;
+ fs::path testFile = fs::current_path() / "data" / filename;
#ifdef TEST_DATA_DIR
if (!fs::exists(testFile))
{
@@ -125,6 +125,9 @@ BOOST_AUTO_TEST_CASE(AlertApplies)
{
BOOST_CHECK(alert.CheckSignature());
}
+
+ BOOST_CHECK(alerts.size() >= 3);
+
// Matches:
BOOST_CHECK(alerts[0].AppliesTo(1, ""));
BOOST_CHECK(alerts[0].AppliesTo(70001, ""));
diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
index 5675c40e7..e34680db9 100644
--- a/src/test/checkblock_tests.cpp
+++ b/src/test/checkblock_tests.cpp
@@ -19,7 +19,7 @@ bool
read_block(const std::string& filename, CBlock& block)
{
namespace fs = boost::filesystem;
- fs::path testFile = fs::current_path() / "test" / "data" / filename;
+ fs::path testFile = fs::current_path() / "data" / filename;
#ifdef TEST_DATA_DIR
if (!fs::exists(testFile))
{
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index c1f6f178d..423a2ff18 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -93,7 +93,7 @@ Array
read_json(const std::string& filename)
{
namespace fs = boost::filesystem;
- fs::path testFile = fs::current_path() / "test" / "data" / filename;
+ fs::path testFile = fs::current_path() / "data" / filename;
#ifdef TEST_DATA_DIR
if (!fs::exists(testFile))