19 #ifndef TORC_BITSTREAM_TESTHELPERS_HPP
20 #define TORC_BITSTREAM_TESTHELPERS_HPP
22 #include <boost/filesystem.hpp>
32 if(inVector1.size() != inVector2.size())
return false;
34 typename V::const_iterator p1 = inVector1.begin();
35 typename V::const_iterator e1 = inVector1.end();
36 typename V::const_iterator p2 = inVector2.begin();
39 const P& packet1 = *p1++;
40 const P& packet2 = *p2++;
42 uint32_t size1 = packet1.getWordSize();
43 uint32_t size2 = packet2.getWordSize();
44 if(size1 != size2)
return false;
46 for(uint32_t i = 0; i < size1; i++)
if(packet1[i] != packet2[i])
return false;
55 bool inDebug =
false) {
56 std::fstream fileStream(inPath.string().c_str(), std::ios::binary | std::ios::in);
59 bitstream1.read(fileStream,
false);
60 V bitstream2(bitstream1);
62 if(inDebug) std::cout << bitstream1 << std::endl;
63 bitstream2.preflightPackets();
64 if(inDebug) std::cout << bitstream2 << std::endl;
66 return packetVectorsAreIdentical<V, typename V::value_type>(bitstream1, bitstream2);
72 #endif // TORC_BITSTREAM_TESTHELPERS_HPP
boost::filesystem::path path
bool checkCRC(boost::filesystem::path inPath, bool inDebug=false)
Template function to recalculate bitstream CRC checksums and compare to reference values...
bool packetVectorsAreIdentical(const V &inVector1, const V &inVector2)
Template function to compare the contents of two packet vectors.