23 #include <boost/test/minimal.hpp>
24 #include <boost/crc.hpp>
26 #include <libopenraw++/rawdata.h>
29 #include "rawcontainer.h"
30 #include "jfifcontainer.h"
31 #include "ljpegdecompressor.h"
32 #include "ljpegdecompressor_priv.h"
37 std::string g_testfile;
41 int test_main(
int argc,
char *argv[])
45 const char * srcdir = getenv(
"srcdir");
47 BOOST_ASSERT(srcdir != NULL);
48 g_testfile = std::string(srcdir);
49 g_testfile +=
"/ljpegtest1.jpg";
57 File *s =
new File(g_testfile.c_str());
62 decompData = decompressor.decompress();
64 boost::crc_optimal<8, 0x1021, 0xFFFF, 0, false, false> crc_ccitt2;
65 const uint8_t * data =
static_cast<uint8_t *
>(decompData->data());
66 size_t data_len = decompData->
size();
67 crc_ccitt2 = std::for_each( data, data + data_len, crc_ccitt2 );
68 BOOST_CHECK(crc_ccitt2() == 0x49);