Fix tests after recent refactors
[novacoin.git] / src / test / miner_tests.cpp
1 #include <boost/test/unit_test.hpp>
2
3 #include "uint256.h"
4 #include "util.h"
5
6 extern void SHA256Transform(void* pstate, void* pinput, const void* pinit);
7
8 BOOST_AUTO_TEST_SUITE(miner_tests)
9
10 BOOST_AUTO_TEST_CASE(sha256transform_equality)
11 {
12     unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
13
14
15     // unsigned char pstate[32];
16     unsigned char pinput[64];
17
18     int i;
19
20     for (i = 0; i < 32; i++) {
21         pinput[i] = i;
22         pinput[i+32] = 0;
23     }
24
25     uint256 hash;
26
27     SHA256Transform(&hash, pinput, pSHA256InitState);
28
29     BOOST_TEST_MESSAGE(hash.GetHex());
30
31     uint256 hash_reference("0x2df5e1c65ef9f8cde240d23cae2ec036d31a15ec64bc68f64be242b1da6631f3");
32
33     BOOST_CHECK(hash == hash_reference);
34 }
35
36 BOOST_AUTO_TEST_SUITE_END()