00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <boost/test/unit_test.hpp>
00020 #include "torc/bitstream/Bitstream.hpp"
00021 #include "torc/common/DeviceDesignator.hpp"
00022 #include "torc/common/DirectoryTree.hpp"
00023 #include <fstream>
00024 #include <iostream>
00025
00026 namespace torc {
00027 namespace bitstream {
00028
00029 BOOST_AUTO_TEST_SUITE(bitstream)
00030
00031
00032
00033 BOOST_AUTO_TEST_CASE(BitstreamUnitTest) {
00034
00035
00036 boost::filesystem::path regressionPath
00037 = torc::common::DirectoryTree::getExecutablePath() / "regression";
00038 boost::filesystem::path generatedPath = regressionPath / "Virtex5UnitTest.generated.bit";
00039 boost::filesystem::path referencePath = regressionPath / "Virtex5UnitTest.reference.bit";
00040
00041
00042 std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
00043 BOOST_REQUIRE(fileStream.good());
00044 Bitstream bitstream;
00045 bitstream.readHeader(fileStream);
00046 bitstream.cleanDateAndTime();
00047
00048
00049 std::cout << bitstream << std::endl;
00050 std::string deviceName = bitstream.getDeviceName();
00051 torc::common::DeviceDesignator deviceDesignator(deviceName);
00052 std::cout << "family is " << deviceDesignator.getFamily() << std::endl;
00053
00054 }
00055
00056 BOOST_AUTO_TEST_SUITE_END()
00057
00058 }
00059 }