]>
Commit | Line | Data |
---|---|---|
1c2d079d | 1 | #ifndef BOOST_TEST_DYN_LINK |
2e28d1f0 | 2 | #define BOOST_TEST_DYN_LINK |
1c2d079d FM |
3 | #endif |
4 | ||
2e28d1f0 | 5 | #define BOOST_TEST_NO_MAIN |
870a0fe4 AT |
6 | #ifdef HAVE_CONFIG_H |
7 | #include "config.h" | |
8 | #endif | |
2e28d1f0 AT |
9 | #include <boost/test/unit_test.hpp> |
10 | #include <boost/assign/list_of.hpp> | |
fa8fd4d2 | 11 | |
bfcdbc13 | 12 | #include "digests.hh" |
2e28d1f0 AT |
13 | #include "misc.hh" |
14 | ||
15 | using namespace boost; | |
16 | ||
bfcdbc13 | 17 | BOOST_AUTO_TEST_SUITE(test_digests_hh) |
2e28d1f0 | 18 | |
2e28d1f0 AT |
19 | BOOST_AUTO_TEST_CASE(test_pdns_md5sum) |
20 | { | |
99be55f0 | 21 | std::string result = "a3 24 8c e3 1a 88 a6 40 e6 30 73 98 57 6d 06 9e "; |
f2e4e85a | 22 | std::string sum = pdns::md5("a quick brown fox jumped over the lazy dog"); |
bfcdbc13 | 23 | |
99be55f0 | 24 | BOOST_CHECK_EQUAL(makeHexDump(sum), result); |
bfcdbc13 RG |
25 | } |
26 | ||
27 | BOOST_AUTO_TEST_CASE(test_pdns_sha1sum) | |
28 | { | |
99be55f0 | 29 | std::string result = "b9 37 10 0d c9 57 b3 86 d9 cb 77 fc 90 c0 18 22 fd eb 6e 7f "; |
f2e4e85a | 30 | std::string sum = pdns::sha1("a quick brown fox jumped over the lazy dog"); |
bfcdbc13 | 31 | |
99be55f0 | 32 | BOOST_CHECK_EQUAL(makeHexDump(sum), result); |
2e28d1f0 AT |
33 | } |
34 | ||
35 | BOOST_AUTO_TEST_SUITE_END() |