torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::common Namespace Reference

Data Structures

class  Annotated
 Concept for any object that can be annotated. More...
 
class  DeviceDesignator
 Encapsulation of a device designator and its constituent elements. More...
 
class  DeviceFamilyHelper
 Helper class to initialize device map and list information. More...
 
class  Devices
 Encapsulation of filesystem paths that are used by the library. More...
 
class  DirectoryTree
 Encapsulation of filesystem paths that are used by the library. More...
 
struct  DottedVersion
 Encapsulation of dotted decimal DottedVersion numbers. More...
 
class  EncapsulatedInteger
 Template base for encapsulated integers, to enforce strong typing. More...
 
class  NullStreamBuffer
 Null stream buffer used by NullOutputStream. More...
 
class  NullOutputStream
 Output stream that discards everything it receives. More...
 

Typedefs

typedef std::vector< std::string > DeviceVector
 Vector of device names. More...
 
typedef std::map< std::string,
enum EDevice
DeviceNameMap
 Map of device names. More...
 

Enumerations

enum  EDevice {
  eDeviceInvalid = 0, eXC3S100E, eXC3S250E, eXC3S500E,
  eXC3S1200E, eXC3S1600E, eXC6SLX4, eXC6SLX9,
  eXC6SLX16, eXC6SLX25, eXC6SLX45, eXC6SLX75,
  eXC6SLX100, eXC6SLX150, eXC6SLX25T, eXC6SLX45T,
  eXC6SLX75T, eXC6SLX100T, eXC6SLX150T, eXCV50,
  eXCV100, eXCV150, eXCV200, eXCV300,
  eXCV400, eXCV600, eXCV800, eXCV1000,
  eXCV50E, eXCV100E, eXCV200E, eXCV300E,
  eXCV400E, eXCV600E, eXCV1000E, eXCV1600E,
  eXCV2000E, eXCV2600E, eXCV3200E, eXCV405E,
  eXCV812E, eXC2V40, eXC2V80, eXC2V250,
  eXC2V500, eXC2V1000, eXC2V1500, eXC2V2000,
  eXC2V3000, eXC2V4000, eXC2V6000, eXC2V8000,
  eXC2VP2, eXC2VP4, eXC2VP7, eXC2VP20,
  eXC2VP30, eXC2VP40, eXC2VP50, eXC2VP70,
  eXC2VP100, eXC2VPX20, eXC2VPX70, eXC4VFX12,
  eXC4VFX20, eXC4VFX40, eXC4VFX60, eXC4VFX100,
  eXC4VFX140, eXC4VLX15, eXC4VLX25, eXC4VLX40,
  eXC4VLX60, eXC4VLX80, eXC4VLX100, eXC4VLX160,
  eXC4VLX200, eXC4VSX25, eXC4VSX35, eXC4VSX55,
  eXC5VFX30T, eXC5VFX70T, eXC5VFX100T, eXC5VFX130T,
  eXC5VFX200T, eXC5VLX30, eXC5VLX50, eXC5VLX85,
  eXC5VLX110, eXC5VLX155, eXC5VLX220, eXC5VLX330,
  eXC5VLX20T, eXC5VLX30T, eXC5VLX50T, eXC5VLX85T,
  eXC5VLX110T, eXC5VLX155T, eXC5VLX220T, eXC5VLX330T,
  eXC5VSX35T, eXC5VSX50T, eXC5VSX95T, eXC5VSX240T,
  eXC5VTX150T, eXC5VTX240T, eXC6VCX75T, eXC6VCX130T,
  eXC6VCX195T, eXC6VCX240T, eXC6VHX250T, eXC6VHX255T,
  eXC6VHX380T, eXC6VHX565T, eXC6VLX75T, eXC6VLX130T,
  eXC6VLX195T, eXC6VLX240T, eXC6VLX365T, eXC6VLX550T,
  eXC6VLX760, eXC6VSX315T, eXC6VSX475T, eXC7A100T,
  eXC7A200T, eXC7K70T, eXC7K160T, eXC7K325T,
  eXC7K355T, eXC7K410T, eXC7K420T, eXC7K480T,
  eXC7V585T, eXC7V2000T, eXC7VH580T, eXC7VH870T,
  eXC7VX330T, eXC7VX415T, eXC7VX485T, eXC7VX550T,
  eXC7VX690T, eXC7VX980T, eXC7VX1140T, eXC7Z010,
  eXC7Z020, eXC7Z030, eXC7Z045, eDeviceCount
}
 Enumeration of all supported devices. More...
 

Functions

 BOOST_AUTO_TEST_CASE (AnnotatedUnitTest)
 Unit test for the Annotated class. More...
 
std::ostream & operator<< (std::ostream &os, const DeviceDesignator &rhs)
 
 BOOST_AUTO_TEST_CASE (DeviceDesignatorUnitTest)
 Unit test for the DeviceDesignator class. More...
 
 BOOST_AUTO_TEST_CASE (DevicesUnitTest)
 Unit test for the Devices class. More...
 
const std::string cDevicesNameConst ("devices")
 Name of the devices directory. More...
 
const std::string cTorcNameConst ("torc")
 Name of the torc directory. More...
 
 BOOST_AUTO_TEST_CASE (DirectoryTreeUnitTest)
 Unit test for the directory tree. More...
 
 BOOST_AUTO_TEST_CASE (DottedVersionUnitTest)
 Unit test for the DottedVersion class. More...
 
 BOOST_AUTO_TEST_CASE (EncapsulatedIntegerSizeUnitTest)
 Unit test for standard integer sizes. More...
 
 BOOST_AUTO_TEST_CASE (EncapsulatedIntegerLimitsUnitTest)
 Unit test for encapsulated integers. More...
 
boost::uint64_t ntohll (const boost::uint64_t &x)
 Convert 64-bit types from network to host byte order. More...
 
boost::uint64_t htonll (const boost::uint64_t &x)
 Convert 64-bit types from host to network byte order. More...
 
 BOOST_AUTO_TEST_CASE (EndianUnitTest)
 Unit test for endian conversion. More...
 
 BOOST_AUTO_TEST_CASE (NullOutputStreamUnitTest)
 Unit test for the NullOutputStream class. More...
 
bool readFileIntoString (const boost::filesystem::path &inPath, std::string &outString)
 Read the raw contents of the specified file into a std::string. More...
 
bool fileContentsAreEqual (const boost::filesystem::path &inA, const boost::filesystem::path &inB)
 Compare the raw contents of two files to determine whether they are identical. More...
 

Variables

NullOutputStream cnull
 Global null output stream. More...
 

Typedef Documentation

typedef std::map<std::string, enum EDevice> torc::common::DeviceNameMap

Map of device names.

Definition at line 122 of file Devices.hpp.

typedef std::vector<std::string> torc::common::DeviceVector

Vector of device names.

Definition at line 119 of file Devices.hpp.

Enumeration Type Documentation

Enumeration of all supported devices.

Enumerator
eDeviceInvalid 
eXC3S100E 
eXC3S250E 
eXC3S500E 
eXC3S1200E 
eXC3S1600E 
eXC6SLX4 
eXC6SLX9 
eXC6SLX16 
eXC6SLX25 
eXC6SLX45 
eXC6SLX75 
eXC6SLX100 
eXC6SLX150 
eXC6SLX25T 
eXC6SLX45T 
eXC6SLX75T 
eXC6SLX100T 
eXC6SLX150T 
eXCV50 
eXCV100 
eXCV150 
eXCV200 
eXCV300 
eXCV400 
eXCV600 
eXCV800 
eXCV1000 
eXCV50E 
eXCV100E 
eXCV200E 
eXCV300E 
eXCV400E 
eXCV600E 
eXCV1000E 
eXCV1600E 
eXCV2000E 
eXCV2600E 
eXCV3200E 
eXCV405E 
eXCV812E 
eXC2V40 
eXC2V80 
eXC2V250 
eXC2V500 
eXC2V1000 
eXC2V1500 
eXC2V2000 
eXC2V3000 
eXC2V4000 
eXC2V6000 
eXC2V8000 
eXC2VP2 
eXC2VP4 
eXC2VP7 
eXC2VP20 
eXC2VP30 
eXC2VP40 
eXC2VP50 
eXC2VP70 
eXC2VP100 
eXC2VPX20 
eXC2VPX70 
eXC4VFX12 
eXC4VFX20 
eXC4VFX40 
eXC4VFX60 
eXC4VFX100 
eXC4VFX140 
eXC4VLX15 
eXC4VLX25 
eXC4VLX40 
eXC4VLX60 
eXC4VLX80 
eXC4VLX100 
eXC4VLX160 
eXC4VLX200 
eXC4VSX25 
eXC4VSX35 
eXC4VSX55 
eXC5VFX30T 
eXC5VFX70T 
eXC5VFX100T 
eXC5VFX130T 
eXC5VFX200T 
eXC5VLX30 
eXC5VLX50 
eXC5VLX85 
eXC5VLX110 
eXC5VLX155 
eXC5VLX220 
eXC5VLX330 
eXC5VLX20T 
eXC5VLX30T 
eXC5VLX50T 
eXC5VLX85T 
eXC5VLX110T 
eXC5VLX155T 
eXC5VLX220T 
eXC5VLX330T 
eXC5VSX35T 
eXC5VSX50T 
eXC5VSX95T 
eXC5VSX240T 
eXC5VTX150T 
eXC5VTX240T 
eXC6VCX75T 
eXC6VCX130T 
eXC6VCX195T 
eXC6VCX240T 
eXC6VHX250T 
eXC6VHX255T 
eXC6VHX380T 
eXC6VHX565T 
eXC6VLX75T 
eXC6VLX130T 
eXC6VLX195T 
eXC6VLX240T 
eXC6VLX365T 
eXC6VLX550T 
eXC6VLX760 
eXC6VSX315T 
eXC6VSX475T 
eXC7A100T 
eXC7A200T 
eXC7K70T 
eXC7K160T 
eXC7K325T 
eXC7K355T 
eXC7K410T 
eXC7K420T 
eXC7K480T 
eXC7V585T 
eXC7V2000T 
eXC7VH580T 
eXC7VH870T 
eXC7VX330T 
eXC7VX415T 
eXC7VX485T 
eXC7VX550T 
eXC7VX690T 
eXC7VX980T 
eXC7VX1140T 
eXC7Z010 
eXC7Z020 
eXC7Z030 
eXC7Z045 
eDeviceCount 

Definition at line 32 of file Devices.hpp.

32  {
33  eDeviceInvalid = 0,
34  // Spartan3E
35  // Spartan3E
37  // Spartan6
38  // Spartan6 LX
41  // Spartan6 LXT
43  // Virtex
44  // Virtex
46  // VirtexE
47  // VirtexE
50  // VirtexEM
52  // Virtex2
53  // Virtex2
56  // Virtex2P
57  // Virtex2P
59  // Virtex2P X
61  // Virtex4
62  // Virtex4 FX
64  // Virtex4 LX
66  eXC4VLX200,
67  // Virtex4 SX
69  // Virtex5
70  // Virtex5 FXT
72  // Virtex5 LX
74  // Virtex5 LXT
76  eXC5VLX330T,
77  // Virtex5 SXT
79  // Virtex5 TXT
81  // Virtex6
82  // Virtex6 CXT
84  // Virtex6 HXT
86  // Virtex6 LXT
88  eXC6VLX760,
89  // Virtex6 SXT
91  // The 7-Series families have been very volatile:
92  // Artix7:
93  // xc7a8, xc7a15, xc7a30t, xc7a50t were removed from ISE 14.1
94  // xc7a350t was removed from ISE 14.3
95  // Virtex7:
96  // xc7vh290t, xc7vh580t, xc7vh870t were added to ISE 14.1
97  // xc7vh290t, xc7v1500t were removed from ISE 14.3
98  // Artix7
99  // Artix7 T
101  // Kintex7
102  // Kintex7 T
104  // Virtex7
105  // Virtex7 T
107  // Virtex7 HT
109  // Virtex7 XT
111  // Zynq7000
112  // Zynq7000
114  // end
116  };

Function Documentation

torc::common::BOOST_AUTO_TEST_CASE ( DevicesUnitTest  )

Unit test for the Devices class.

Definition at line 28 of file DevicesUnitTest.cpp.

28  {
29  // members untested
30  // DeviceVector mVirtexDevices;
31  // DeviceVector mVirtexEDevices;
32  // DeviceVector mVirtex2Devices;
33  // DeviceVector mVirtex2PDevices;
34  // DeviceVector mVirtex4Devices;
35  // DeviceVector mVirtex5Devices;
36  // DeviceVector mVirtex6Devices;
37  // DeviceVector mArtix7Devices;
38  // DeviceVector mKintex7Devices;
39  // DeviceVector mVirtex7Devices;
40  // DeviceVector mSpartan3EDevices;
41  // DeviceVector mSpartan6Devices;
42  // functions untested:
43  // static const DeviceVector& getVirtexDevices(void);
44  // static const DeviceVector& getVirtexEDevices(void);
45  // static const DeviceVector& getVirtex2Devices(void);
46  // static const DeviceVector& getVirtex2PDevices(void);
47  // static const DeviceVector& getVirtex4Devices(void);
48  // static const DeviceVector& getVirtex5Devices(void);
49  // static const DeviceVector& getVirtex6Devices(void);
50  // static const DeviceVector& getArtix7Devices(void);
51  // static const DeviceVector& getKintex7Devices(void);
52  // static const DeviceVector& getVirtex7Devices(void);
53  // static const DeviceVector& getSpartan3EDevices(void);
54  // static const DeviceVector& getSpartan6Devices(void);
55 
56  // members tested:
57  // static Devices sDevices;
58  // DeviceVector mSupportedDevices;
59  // functions tested:
60  // Devices(void);
61  // void addToSupportedDevices(const DeviceVector& inDeviceVector);
62  // static const DeviceVector& getSupportedDevices(void);
63  BOOST_CHECK(Devices::getSupportedDevices().size() > 0);
64 
65  // members tested:
66  // enum EDevice;
67  // DeviceNameMap mDeviceNameMap;
68  // functions tested:
69  // static EDevice getDeviceEnum(const string& inName);
70  // static const DeviceNameMap& getDeviceNameMap(void);
71  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv50"), eXCV50);
72  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv100"), eXCV100);
73  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv150"), eXCV150);
74  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv200"), eXCV200);
75  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv300"), eXCV300);
76  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv400"), eXCV400);
77  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv600"), eXCV600);
78  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv800"), eXCV800);
79  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv1000"), eXCV1000);
80  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv50e"), eXCV50E);
81  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv100e"), eXCV100E);
82  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv200e"), eXCV200E);
83  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv300e"), eXCV300E);
84  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv400e"), eXCV400E);
85  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv405e"), eXCV405E);
86  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv600e"), eXCV600E);
87  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv812e"), eXCV812E);
88  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv1000e"), eXCV1000E);
89  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv1600e"), eXCV1600E);
90  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv2000e"), eXCV2000E);
91  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv2600e"), eXCV2600E);
92  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xcv3200e"), eXCV3200E);
93  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v40"), eXC2V40);
94  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v80"), eXC2V80);
95  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v250"), eXC2V250);
96  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v500"), eXC2V500);
97  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v1000"), eXC2V1000);
98  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v1500"), eXC2V1500);
99  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v2000"), eXC2V2000);
100  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v3000"), eXC2V3000);
101  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v4000"), eXC2V4000);
102  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v6000"), eXC2V6000);
103  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2v8000"), eXC2V8000);
104  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp2"), eXC2VP2);
105  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp4"), eXC2VP4);
106  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp7"), eXC2VP7);
107  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp20"), eXC2VP20);
108  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp30"), eXC2VP30);
109  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp40"), eXC2VP40);
110  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp50"), eXC2VP50);
111  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp70"), eXC2VP70);
112  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vp100"), eXC2VP100);
113  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vpx20"), eXC2VPX20);
114  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc2vpx70"), eXC2VPX70);
115  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx12"), eXC4VFX12);
116  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx20"), eXC4VFX20);
117  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx40"), eXC4VFX40);
118  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx60"), eXC4VFX60);
119  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx100"), eXC4VFX100);
120  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vfx140"), eXC4VFX140);
121  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx15"), eXC4VLX15);
122  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx25"), eXC4VLX25);
123  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx40"), eXC4VLX40);
124  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx60"), eXC4VLX60);
125  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx80"), eXC4VLX80);
126  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx100"), eXC4VLX100);
127  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx160"), eXC4VLX160);
128  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vlx200"), eXC4VLX200);
129  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vsx25"), eXC4VSX25);
130  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vsx35"), eXC4VSX35);
131  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc4vsx55"), eXC4VSX55);
132  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vfx30t"), eXC5VFX30T);
133  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vfx70t"), eXC5VFX70T);
134  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vfx100t"), eXC5VFX100T);
135  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vfx130t"), eXC5VFX130T);
136  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vfx200t"), eXC5VFX200T);
137  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx30"), eXC5VLX30);
138  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx50"), eXC5VLX50);
139  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx85"), eXC5VLX85);
140  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx110"), eXC5VLX110);
141  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx155"), eXC5VLX155);
142  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx220"), eXC5VLX220);
143  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx330"), eXC5VLX330);
144  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx20t"), eXC5VLX20T);
145  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx30t"), eXC5VLX30T);
146  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx50t"), eXC5VLX50T);
147  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx85t"), eXC5VLX85T);
148  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx110t"), eXC5VLX110T);
149  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx155t"), eXC5VLX155T);
150  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx220t"), eXC5VLX220T);
151  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vlx330t"), eXC5VLX330T);
152  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vsx35t"), eXC5VSX35T);
153  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vsx50t"), eXC5VSX50T);
154  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vsx95t"), eXC5VSX95T);
155  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vsx240t"), eXC5VSX240T);
156  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vtx150t"), eXC5VTX150T);
157  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc5vtx240t"), eXC5VTX240T);
158  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vcx75t"), eXC6VCX75T);
159  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vcx130t"), eXC6VCX130T);
160  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vcx195t"), eXC6VCX195T);
161  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vcx240t"), eXC6VCX240T);
162  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vhx250t"), eXC6VHX250T);
163  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vhx255t"), eXC6VHX255T);
164  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vhx380t"), eXC6VHX380T);
165  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vhx565t"), eXC6VHX565T);
166  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx75t"), eXC6VLX75T);
167  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx130t"), eXC6VLX130T);
168  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx195t"), eXC6VLX195T);
169  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx240t"), eXC6VLX240T);
170  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx365t"), eXC6VLX365T);
171  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx550t"), eXC6VLX550T);
172  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vlx760"), eXC6VLX760);
173  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vsx315t"), eXC6VSX315T);
174  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6vsx475t"), eXC6VSX475T);
175  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7a100t"), eXC7A100T);
176  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7a200t"), eXC7A200T);
177  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k70t"), eXC7K70T);
178  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k160t"), eXC7K160T);
179  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k325t"), eXC7K325T);
180  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k355t"), eXC7K355T);
181  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k410t"), eXC7K410T);
182  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k420t"), eXC7K420T);
183  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7k480t"), eXC7K480T);
184  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7v585t"), eXC7V585T);
185  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7v2000t"), eXC7V2000T);
186  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vh580t"), eXC7VH580T);
187  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vh870t"), eXC7VH870T);
188  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx330t"), eXC7VX330T);
189  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx415t"), eXC7VX415T);
190  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx485t"), eXC7VX485T);
191  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx550t"), eXC7VX550T);
192  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx690t"), eXC7VX690T);
193  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx980t"), eXC7VX980T);
194  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7vx1140t"), eXC7VX1140T);
195  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7z010"), eXC7Z010);
196  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7z020"), eXC7Z020);
197  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7z030"), eXC7Z030);
198  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc7z045"), eXC7Z045);
199  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc3s100e"), eXC3S100E);
200  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc3s250e"), eXC3S250E);
201  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc3s500e"), eXC3S500E);
202  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc3s1200e"), eXC3S1200E);
203  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc3s1600e"), eXC3S1600E);
204  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx4"), eXC6SLX4);
205  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx9"), eXC6SLX9);
206  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx16"), eXC6SLX16);
207  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx25"), eXC6SLX25);
208  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx45"), eXC6SLX45);
209  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx75"), eXC6SLX75);
210  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx100"), eXC6SLX100);
211  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx150"), eXC6SLX150);
212  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx25t"), eXC6SLX25T);
213  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx45t"), eXC6SLX45T);
214  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx75t"), eXC6SLX75T);
215  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx100t"), eXC6SLX100T);
216  BOOST_CHECK_EQUAL(Devices::getDeviceEnum("xc6slx150t"), eXC6SLX150T);
217 
218  // members tested:
219  // DeviceVector mDeviceNames;
220  // functions tested:
221  // static const string& getDeviceName(EDevice inEnum);
222  // static const DeviceVector& getDeviceNames(void);
223  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV50), "xcv50");
224  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV100), "xcv100");
225  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV150), "xcv150");
226  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV200), "xcv200");
227  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV300), "xcv300");
228  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV400), "xcv400");
229  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV600), "xcv600");
230  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV800), "xcv800");
231  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV1000), "xcv1000");
232  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV50E), "xcv50e");
233  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV100E), "xcv100e");
234  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV200E), "xcv200e");
235  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV300E), "xcv300e");
236  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV400E), "xcv400e");
237  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV405E), "xcv405e");
238  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV600E), "xcv600e");
239  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV812E), "xcv812e");
240  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV1000E), "xcv1000e");
241  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV1600E), "xcv1600e");
242  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV2000E), "xcv2000e");
243  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV2600E), "xcv2600e");
244  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXCV3200E), "xcv3200e");
245  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V40), "xc2v40");
246  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V80), "xc2v80");
247  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V250), "xc2v250");
248  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V500), "xc2v500");
249  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V1000), "xc2v1000");
250  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V1500), "xc2v1500");
251  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V2000), "xc2v2000");
252  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V3000), "xc2v3000");
253  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V4000), "xc2v4000");
254  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V6000), "xc2v6000");
255  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2V8000), "xc2v8000");
256  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP2), "xc2vp2");
257  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP4), "xc2vp4");
258  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP7), "xc2vp7");
259  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP20), "xc2vp20");
260  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP30), "xc2vp30");
261  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP40), "xc2vp40");
262  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP50), "xc2vp50");
263  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP70), "xc2vp70");
264  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VP100), "xc2vp100");
265  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VPX20), "xc2vpx20");
266  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC2VPX70), "xc2vpx70");
267  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX12), "xc4vfx12");
268  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX20), "xc4vfx20");
269  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX40), "xc4vfx40");
270  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX60), "xc4vfx60");
271  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX100), "xc4vfx100");
272  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VFX140), "xc4vfx140");
273  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX15), "xc4vlx15");
274  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX25), "xc4vlx25");
275  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX40), "xc4vlx40");
276  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX60), "xc4vlx60");
277  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX80), "xc4vlx80");
278  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX100), "xc4vlx100");
279  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX160), "xc4vlx160");
280  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VLX200), "xc4vlx200");
281  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VSX25), "xc4vsx25");
282  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VSX35), "xc4vsx35");
283  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC4VSX55), "xc4vsx55");
284  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VFX30T), "xc5vfx30t");
285  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VFX70T), "xc5vfx70t");
286  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VFX100T), "xc5vfx100t");
287  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VFX130T), "xc5vfx130t");
288  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VFX200T), "xc5vfx200t");
289  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX30), "xc5vlx30");
290  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX50), "xc5vlx50");
291  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX85), "xc5vlx85");
292  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX110), "xc5vlx110");
293  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX155), "xc5vlx155");
294  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX220), "xc5vlx220");
295  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX330), "xc5vlx330");
296  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX20T), "xc5vlx20t");
297  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX30T), "xc5vlx30t");
298  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX50T), "xc5vlx50t");
299  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX85T), "xc5vlx85t");
300  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX110T), "xc5vlx110t");
301  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX155T), "xc5vlx155t");
302  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX220T), "xc5vlx220t");
303  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VLX330T), "xc5vlx330t");
304  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VSX35T), "xc5vsx35t");
305  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VSX50T), "xc5vsx50t");
306  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VSX95T), "xc5vsx95t");
307  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VSX240T), "xc5vsx240t");
308  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VTX150T), "xc5vtx150t");
309  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC5VTX240T), "xc5vtx240t");
310  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VCX75T), "xc6vcx75t");
311  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VCX130T), "xc6vcx130t");
312  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VCX195T), "xc6vcx195t");
313  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VCX240T), "xc6vcx240t");
314  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VHX250T), "xc6vhx250t");
315  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VHX255T), "xc6vhx255t");
316  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VHX380T), "xc6vhx380t");
317  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VHX565T), "xc6vhx565t");
318  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX75T), "xc6vlx75t");
319  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX130T), "xc6vlx130t");
320  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX195T), "xc6vlx195t");
321  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX240T), "xc6vlx240t");
322  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX365T), "xc6vlx365t");
323  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX550T), "xc6vlx550t");
324  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VLX760), "xc6vlx760");
325  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VSX315T), "xc6vsx315t");
326  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6VSX475T), "xc6vsx475t");
327  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7A100T), "xc7a100t");
328  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7A200T), "xc7a200t");
329  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K70T), "xc7k70t");
330  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K160T), "xc7k160t");
331  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K325T), "xc7k325t");
332  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K355T), "xc7k355t");
333  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K410T), "xc7k410t");
334  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K420T), "xc7k420t");
335  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7K480T), "xc7k480t");
336  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7V585T), "xc7v585t");
337  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7V2000T), "xc7v2000t");
338  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VH580T), "xc7vh580t");
339  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VH870T), "xc7vh870t");
340  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX330T), "xc7vx330t");
341  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX415T), "xc7vx415t");
342  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX485T), "xc7vx485t");
343  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX550T), "xc7vx550t");
344  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX690T), "xc7vx690t");
345  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX980T), "xc7vx980t");
346  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7VX1140T), "xc7vx1140t");
347  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7Z010), "xc7z010");
348  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7Z020), "xc7z020");
349  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7Z030), "xc7z030");
350  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC7Z045), "xc7z045");
351  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC3S100E), "xc3s100e");
352  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC3S250E), "xc3s250e");
353  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC3S500E), "xc3s500e");
354  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC3S1200E), "xc3s1200e");
355  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC3S1600E), "xc3s1600e");
356  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX4), "xc6slx4");
357  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX9), "xc6slx9");
358  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX16), "xc6slx16");
359  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX25), "xc6slx25");
360  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX45), "xc6slx45");
361  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX75), "xc6slx75");
362  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX100), "xc6slx100");
363  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX150), "xc6slx150");
364  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX25T), "xc6slx25t");
365  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX45T), "xc6slx45t");
366  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX75T), "xc6slx75t");
367  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX100T), "xc6slx100t");
368  BOOST_CHECK_EQUAL(Devices::getDeviceName(eXC6SLX150T), "xc6slx150t");
369 
370 }

+ Here is the call graph for this function:

torc::common::BOOST_AUTO_TEST_CASE ( DirectoryTreeUnitTest  )

Unit test for the directory tree.

Definition at line 28 of file DirectoryTreeUnitTest.cpp.

28  {
29  // look up the command line arguments
30  int& argc = boost::unit_test::framework::master_test_suite().argc;
31  char**& argv = boost::unit_test::framework::master_test_suite().argv;
32  // make sure that we at least have the name under which we were invoked
33  BOOST_REQUIRE(argc >= 1);
34 
35  // functions tested:
36  // DirectoryTree(const char* argv0);
37  // resolve symbolic links if applicable
38  DirectoryTree directoryTree(argv[0]);
39 
40  // functions tested:
41  // static const boost::filesystem::path& getRelativePath(void);
42  // static const boost::filesystem::path& getWorkingPath(void);
43  // static const boost::filesystem::path& getExecutablePath(void);
44  // static const boost::filesystem::path& getDevicesPath(void);
45  // static const boost::filesystem::path& getLogPath(void);
46  BOOST_CHECK(boost::filesystem::exists(directoryTree.getRelativePath()));
47  BOOST_CHECK(boost::filesystem::exists(directoryTree.getWorkingPath()));
48  BOOST_CHECK(boost::filesystem::exists(directoryTree.getExecutablePath()));
49  BOOST_CHECK(boost::filesystem::exists(directoryTree.getDevicesPath()));
50  BOOST_CHECK(boost::filesystem::exists(directoryTree.getLogPath()));
51 }

+ Here is the call graph for this function:

torc::common::BOOST_AUTO_TEST_CASE ( NullOutputStreamUnitTest  )

Unit test for the NullOutputStream class.

Definition at line 28 of file NullOutputStreamUnitTest.cpp.

28  {
29  // enable all exceptions on the global null output stream, and try writing a bunch of stuff
30  bool passed = true;
31  try {
32  cnull.exceptions(std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit);
33  for(int i = 0; i < 1000000; i++) cnull << i;
34  }
35  catch(...) {
36  passed = false;
37  }
38  BOOST_CHECK(passed);
39 }
NullOutputStream cnull
Global null output stream.
torc::common::BOOST_AUTO_TEST_CASE ( AnnotatedUnitTest  )

Unit test for the Annotated class.

Definition at line 29 of file AnnotatedUnitTest.cpp.

29  {
30 
31  Annotated outer;
32  Annotated inner;
33 
34  boost::uint32_t key0 = 0;
35  boost::uint32_t key1 = 1;
36  boost::uint32_t innerkey = 2;
37 
38  boost::uint32_t value0 = 42;
39  boost::uint32_t innervalue = 99;
40 
41  inner.setAnnotation(innerkey, innervalue);
42 
43  outer.setAnnotation(key0, value0);
44  outer.setAnnotation(key1, inner);
45 
46  BOOST_CHECK_EQUAL(inner.hasAnnotation(innerkey), true);
47  BOOST_CHECK_EQUAL(inner.hasAnnotation(key0), false);
48 
49  BOOST_CHECK_EQUAL(outer.hasAnnotation(key0), true);
50  BOOST_CHECK_EQUAL(outer.hasAnnotation(key1), true);
51 
52  boost::uint32_t val0 = boost::any_cast<boost::uint32_t>(outer.getAnnotation(key0));
53  BOOST_CHECK_EQUAL(val0, value0);
54 
55  BOOST_CHECK_EQUAL(boost::any_cast<boost::uint32_t>((boost::any_cast<Annotated>(
56  outer.getAnnotation(key1))).getAnnotation(innerkey)), innervalue);
57 
58  outer.removeAnnotation(key0);
59  BOOST_CHECK_EQUAL(outer.hasAnnotation(key0), false);
60 
61 }

+ Here is the call graph for this function:

torc::common::BOOST_AUTO_TEST_CASE ( DottedVersionUnitTest  )

Unit test for the DottedVersion class.

Todo:
Update the list of members tested, and add Doxygen comments to the header file.

Definition at line 29 of file DottedVersionUnitTest.cpp.

29  {
30  // functions tested:
31  // DottedVersion(uint8_t inMajor = 0, uint8_t inMinor = 0, uint8_t inRevision = 0,
32  // uint8_t inReserved = 0);
33  // members tested:
34  // uint8_t mMajor;
35  // uint8_t mMinor;
36  // uint8_t mRevision;
37  // uint8_t mReserved;
38  DottedVersion version(1, 2, 3, 4);
39  BOOST_CHECK_EQUAL(version.mMajor, 1);
40  BOOST_CHECK_EQUAL(version.mMinor, 2);
41  BOOST_CHECK_EQUAL(version.mRevision, 3);
42  BOOST_CHECK_EQUAL(version.mReserved, 4);
43  BOOST_CHECK(version == DottedVersion(1, 2, 3));
44  BOOST_CHECK(version < DottedVersion(1, 2, 4));
45  BOOST_CHECK(version < DottedVersion(1, 3, 3));
46  BOOST_CHECK(version < DottedVersion(2, 2, 3));
47  BOOST_CHECK(version <= DottedVersion(1, 2, 3));
48  BOOST_CHECK(version <= DottedVersion(1, 2, 4));
49  BOOST_CHECK(version <= DottedVersion(1, 3, 3));
50  BOOST_CHECK(version <= DottedVersion(2, 2, 3));
51  BOOST_CHECK(version > DottedVersion(0, 2, 3));
52  BOOST_CHECK(version > DottedVersion(1, 1, 3));
53  BOOST_CHECK(version > DottedVersion(1, 2, 2));
54  BOOST_CHECK(version >= DottedVersion(1, 2, 3));
55  BOOST_CHECK(version >= DottedVersion(0, 2, 3));
56  BOOST_CHECK(version >= DottedVersion(1, 1, 3));
57  BOOST_CHECK(version >= DottedVersion(1, 2, 2));
58  /// \todo Update the list of members tested, and add Doxygen comments to the header file.
59 
60  // just for fun, we'll check the Torc version
61  BOOST_CHECK(torc::cTorcVersion >= DottedVersion(0, 9, 0));
62 }
const torc::common::DottedVersion cTorcVersion(1, 0, 1)
The current Torc version as a DottedVersion object.
Definition: Version.hpp:28
torc::common::BOOST_AUTO_TEST_CASE ( DeviceDesignatorUnitTest  )

Unit test for the DeviceDesignator class.

Definition at line 29 of file DeviceDesignatorUnitTest.cpp.

29  {
30 
31  // functions tested:
32  // DeviceDesignator(const string& inDeviceDesignator);
33  // bool parse(const string& inDeviceDesignator, const boost::regex& inRegEx);
34  DeviceDesignator deviceName0("xc3s1600efg484-5");
35  BOOST_CHECK_EQUAL(deviceName0.getFamily(), DeviceDesignator::eFamilySpartan3E);
36  BOOST_CHECK_EQUAL(deviceName0.getDeviceName(), "xc3s1600e");
37  BOOST_CHECK_EQUAL(deviceName0.getDevicePackage(), "fg484");
38  BOOST_CHECK_EQUAL(deviceName0.getDeviceSpeedGrade(), "-5");
39  DeviceDesignator deviceName1("xcv3200efg1156-8");
40  BOOST_CHECK_EQUAL(deviceName1.getFamily(), DeviceDesignator::eFamilyVirtexE);
41  BOOST_CHECK_EQUAL(deviceName1.getDeviceName(), "xcv3200e");
42  BOOST_CHECK_EQUAL(deviceName1.getDevicePackage(), "fg1156");
43  BOOST_CHECK_EQUAL(deviceName1.getDeviceSpeedGrade(), "-8");
44  DeviceDesignator deviceName2("xc2vp30ff896-7");
45  BOOST_CHECK_EQUAL(deviceName2.getFamily(), DeviceDesignator::eFamilyVirtex2P);
46  BOOST_CHECK_EQUAL(deviceName2.getDeviceName(), "xc2vp30");
47  BOOST_CHECK_EQUAL(deviceName2.getDevicePackage(), "ff896");
48  BOOST_CHECK_EQUAL(deviceName2.getDeviceSpeedGrade(), "-7");
49  DeviceDesignator deviceName3("xc4vfx60ff1152-12");
50  BOOST_CHECK_EQUAL(deviceName3.getFamily(), DeviceDesignator::eFamilyVirtex4);
51  BOOST_CHECK_EQUAL(deviceName3.getDeviceName(), "xc4vfx60");
52  BOOST_CHECK_EQUAL(deviceName3.getDevicePackage(), "ff1152");
53  BOOST_CHECK_EQUAL(deviceName3.getDeviceSpeedGrade(), "-12");
54  DeviceDesignator deviceName4("xc5vfx130tff1738-3");
55  BOOST_CHECK_EQUAL(deviceName4.getFamily(), DeviceDesignator::eFamilyVirtex5);
56  BOOST_CHECK_EQUAL(deviceName4.getDeviceName(), "xc5vfx130t");
57  BOOST_CHECK_EQUAL(deviceName4.getDevicePackage(), "ff1738");
58  BOOST_CHECK_EQUAL(deviceName4.getDeviceSpeedGrade(), "-3");
59  DeviceDesignator deviceName5("xc6vhx380tff1924-3");
60  BOOST_CHECK_EQUAL(deviceName5.getFamily(), DeviceDesignator::eFamilyVirtex6);
61  BOOST_CHECK_EQUAL(deviceName5.getDeviceName(), "xc6vhx380t");
62  BOOST_CHECK_EQUAL(deviceName5.getDevicePackage(), "ff1924");
63  BOOST_CHECK_EQUAL(deviceName5.getDeviceSpeedGrade(), "-3");
64  DeviceDesignator deviceName6("xc7vx485tffg1929-3");
65  BOOST_CHECK_EQUAL(deviceName6.getFamily(), DeviceDesignator::eFamilyVirtex7);
66  BOOST_CHECK_EQUAL(deviceName6.getDeviceName(), "xc7vx485t");
67  BOOST_CHECK_EQUAL(deviceName6.getDevicePackage(), "ffg1929");
68  BOOST_CHECK_EQUAL(deviceName6.getDeviceSpeedGrade(), "-3");
69 
70  // functions tested:
71  // std::ostream& operator<< (std::ostream& os);
72  std::stringstream ss;
73  ss << deviceName6;
74  BOOST_CHECK_EQUAL(ss.str(), "xc7vx485tffg1929-3");
75 
76  // the above tests are not exhaustive
77  //BOOST_CHECK(false);
78 }
torc::common::DeviceDesignator DeviceDesignator

+ Here is the call graph for this function:

torc::common::BOOST_AUTO_TEST_CASE ( EncapsulatedIntegerSizeUnitTest  )

Unit test for standard integer sizes.

Definition at line 30 of file EncapsulatedIntegerUnitTest.cpp.

30  {
31  // types tested:
32  // int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
33  // verify the sizes of 8-, 16-, 32-, and 64-bit integers
34  BOOST_REQUIRE_EQUAL((size_t) 1, sizeof(boost::int8_t));
35  BOOST_REQUIRE_EQUAL((size_t) 1, sizeof(boost::uint8_t));
36  BOOST_REQUIRE_EQUAL((size_t) 2, sizeof(boost::int16_t));
37  BOOST_REQUIRE_EQUAL((size_t) 2, sizeof(boost::uint16_t));
38  BOOST_REQUIRE_EQUAL((size_t) 4, sizeof(boost::int32_t));
39  BOOST_REQUIRE_EQUAL((size_t) 4, sizeof(boost::uint32_t));
40  BOOST_REQUIRE_EQUAL((size_t) 8, sizeof(boost::int64_t));
41  BOOST_REQUIRE_EQUAL((size_t) 8, sizeof(boost::uint64_t));
42 
43  // types tested:
44  // char, short, int, long, long long
45  // verify the sizes of standard integers
46  BOOST_WARN_EQUAL((size_t) 1, sizeof(char));
47  BOOST_WARN_EQUAL((size_t) 2, sizeof(short));
48  BOOST_WARN_EQUAL((size_t) 4, sizeof(int));
49  BOOST_WARN_EQUAL((size_t) 8, sizeof(long));
50  BOOST_WARN_EQUAL((size_t) 8, sizeof(long long));
51 }
torc::common::BOOST_AUTO_TEST_CASE ( EndianUnitTest  )

Unit test for endian conversion.

Definition at line 31 of file EndianUnitTest.cpp.

31  {
32  // ensure that BOOST_BIG_ENDIAN or BOOST_LITTLE_ENDIAN are properly defined
33 #if defined(BOOST_BIG_ENDIAN) && defined(BOOST_LITTLE_ENDIAN)
34  #error("Both BOOST_BIG_ENDIAN and BOOST_LITTLE_ENDIAN are defined.")
35 #endif
36 #if !defined(BOOST_BIG_ENDIAN) && !defined(BOOST_LITTLE_ENDIAN)
37  #error("Neither BOOST_BIG_ENDIAN nor BOOST_LITTLE_ENDIAN are defined.")
38 #endif
39 
40  // functions tested:
41  // htons(uint16_t);
42  // ntohs(uint16_t);
43  // verify 16-bit conversion to and from network order
44  union { char c[2]; boost::uint16_t n; } be16 = {{0x01,0x23}};
45  boost::uint16_t uint16_i_actual = be16.n;
46 #if defined(BOOST_BIG_ENDIAN)
47  boost::uint16_t uint16_h_expected = 0x0123;
48 #else // defined(BOOST_LITTLE_ENDIAN)
49  boost::uint16_t uint16_h_expected = 0x2301;
50 #endif
51  BOOST_CHECK_EQUAL(uint16_h_expected, uint16_i_actual);
52  boost::uint16_t uint16_n_actual = htons(uint16_i_actual);
53  boost::uint16_t uint16_n_expected = 0x0123;
54  BOOST_CHECK_EQUAL(uint16_n_expected, uint16_n_actual);
55  boost::uint16_t uint16_h_actual = ntohs(uint16_n_actual);
56  BOOST_CHECK_EQUAL(uint16_h_expected, uint16_h_actual);
57 
58  // functions tested:
59  // htons(uint32_t);
60  // ntohs(uint32_t);
61  // verify 32-bit conversion to and from network order
62  union { uint8_t c[4]; boost::uint32_t n; } be32 = {{0x01,0x23,0x45,0x67}};
63  boost::uint32_t uint32_i_actual = be32.n;
64 #if defined(BOOST_BIG_ENDIAN)
65  boost::uint32_t uint32_h_expected = 0x01234567;
66 #else // defined(BOOST_LITTLE_ENDIAN)
67  boost::uint32_t uint32_h_expected = 0x67452301;
68 #endif
69  BOOST_CHECK_EQUAL(uint32_h_expected, uint32_i_actual);
70  boost::uint32_t uint32_n_actual = htonl(uint32_i_actual);
71  boost::uint32_t uint32_n_expected = 0x01234567;
72  BOOST_CHECK_EQUAL(uint32_n_expected, uint32_n_actual);
73  boost::uint32_t uint32_h_actual = ntohl(uint32_n_actual);
74  BOOST_CHECK_EQUAL(uint32_h_expected, uint32_h_actual);
75 
76  // functions tested:
77  // htons(uint64_t);
78  // ntohs(uint64_t);
79  // verify 64-bit conversion to and from network order
80  union { uint8_t c[8]; boost::uint64_t n; } be64 = {{0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}};
81  boost::uint64_t uint64_i_actual = be64.n;
82 #if defined(BOOST_BIG_ENDIAN)
83  boost::uint64_t uint64_h_expected = 0x0123456789abcdefll;
84 #else // defined(BOOST_LITTLE_ENDIAN)
85  boost::uint64_t uint64_h_expected = 0xefcdab8967452301ll;
86 #endif
87  BOOST_CHECK_EQUAL(uint64_h_expected, uint64_i_actual);
88  boost::uint64_t uint64_n_actual = htonll(uint64_i_actual);
89  boost::uint64_t uint64_n_expected = 0x0123456789abcdefll;
90  BOOST_CHECK_EQUAL(uint64_n_expected, uint64_n_actual);
91  boost::uint64_t uint64_h_actual = ntohll(uint64_n_actual);
92  BOOST_CHECK_EQUAL(uint64_h_expected, uint64_h_actual);
93 }
boost::uint64_t ntohll(const boost::uint64_t &x)
Convert 64-bit types from network to host byte order.
Definition: Endian.hpp:40
boost::uint64_t htonll(const boost::uint64_t &x)
Convert 64-bit types from host to network byte order.
Definition: Endian.hpp:61

+ Here is the call graph for this function:

torc::common::BOOST_AUTO_TEST_CASE ( EncapsulatedIntegerLimitsUnitTest  )

Unit test for encapsulated integers.

Definition at line 90 of file EncapsulatedIntegerUnitTest.cpp.

90  {
91  // 8-bit unsigned
93  // 8-bit signed
95  // 16-bit unsigned
96  STANDARD_ENCAPSULATED_INTEGER_BLOCK(boost::uint16_t);
97  // 16-bit signed
99  // 32-bit unsigned
100  STANDARD_ENCAPSULATED_INTEGER_BLOCK(boost::uint32_t);
101  // 32-bit signed
102  STANDARD_ENCAPSULATED_INTEGER_BLOCK(boost::int32_t);
103  // 64-bit unsigned
104  STANDARD_ENCAPSULATED_INTEGER_BLOCK(boost::uint64_t);
105  // 64-bit signed
106  STANDARD_ENCAPSULATED_INTEGER_BLOCK(boost::int64_t);
107 }
#define STANDARD_ENCAPSULATED_INTEGER_BLOCK(TYPE)
Standard macro to be used for each of the encapsulated integer types.
const std::string torc::common::cDevicesNameConst ( "devices"  )

Name of the devices directory.

Todo:
This should be obtained from a configuration file.

+ Here is the caller graph for this function:

const std::string torc::common::cTorcNameConst ( "torc"  )

Name of the torc directory.

Todo:
This should be obtained from a configuration file.

+ Here is the caller graph for this function:

bool torc::common::fileContentsAreEqual ( const boost::filesystem::path &  inA,
const boost::filesystem::path &  inB 
)

Compare the raw contents of two files to determine whether they are identical.

Parameters
inAThe boost::filesystem::path for one of the two files.
inBThe boost::filesystem::path for the other of the two files.
Returns
true if the contents of the two files are identical.

Definition at line 43 of file common/TestHelpers.cpp.

43  {
44  std::string a, b;
45  if(!readFileIntoString(inA, a)) return false;
46  if(!readFileIntoString(inB, b)) return false;
47  return a == b;
48 }
bool readFileIntoString(const boost::filesystem::path &inPath, std::string &outString)
Read the raw contents of the specified file into a std::string.
std::string string

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

boost::uint64_t torc::common::htonll ( const boost::uint64_t &  x)
inline

Convert 64-bit types from host to network byte order.

Complements htons and htonl, both found in <netinet/in.h> or <winsock2.h>.

Definition at line 61 of file Endian.hpp.

61  {
62 #ifdef BOOST_BIG_ENDIAN
63  return x;
64 #else
65  return
66  (x>>56) |
67  ((x<<40) & 0x00FF000000000000ull) |
68  ((x<<24) & 0x0000FF0000000000ull) |
69  ((x<<8) & 0x000000FF00000000ull) |
70  ((x>>8) & 0x00000000FF000000ull) |
71  ((x>>24) & 0x0000000000FF0000ull) |
72  ((x>>40) & 0x000000000000FF00ull) |
73  (x<<56);
74 #endif
75 }

+ Here is the caller graph for this function:

boost::uint64_t torc::common::ntohll ( const boost::uint64_t &  x)
inline

Convert 64-bit types from network to host byte order.

Complements ntohs and ntohl, both found in <netinet/in.h> or <winsock2.h>.

Definition at line 40 of file Endian.hpp.

40  {
41 #ifdef BOOST_BIG_ENDIAN
42  return x;
43 #else
44  return
45  (x>>56) |
46  ((x<<40) & 0x00FF000000000000ull) |
47  ((x<<24) & 0x0000FF0000000000ull) |
48  ((x<<8) & 0x000000FF00000000ull) |
49  ((x>>8) & 0x00000000FF000000ull) |
50  ((x>>24) & 0x0000000000FF0000ull) |
51  ((x>>40) & 0x000000000000FF00ull) |
52  (x<<56);
53 #endif
54 }

+ Here is the caller graph for this function:

std::ostream& torc::common::operator<< ( std::ostream &  os,
const DeviceDesignator &  rhs 
)

Definition at line 185 of file DeviceDesignator.cpp.

185  {
186  os << rhs.getDeviceName();
187  if(rhs.getDevicePackage().length()) os << rhs.getDevicePackage();
188  if(rhs.getDeviceSpeedGrade().length()) os << rhs.getDeviceSpeedGrade();
189  return os;
190  }

+ Here is the call graph for this function:

bool torc::common::readFileIntoString ( const boost::filesystem::path &  inPath,
std::string &  outString 
)

Read the raw contents of the specified file into a std::string.

Parameters
inPathThe boost::filesystem::path for the file of interest.
outStringThe string in which to place the raw file contents.
Returns
true if the file contents were read successfully.

Definition at line 25 of file common/TestHelpers.cpp.

25  {
26  // open the file and point to the end of it
27  std::ifstream input(inPath.string().c_str(), std::ios::in | std::ios::binary | std::ios::ate);
28  if(input.is_open()) {
29  // resize the string according to the file length
30  std::ifstream::pos_type size = input.tellg();
31  outString.resize(size);
32  // rewind to the beginning and read the entire file directly into the string
33  input.seekg(0, std::ios::beg);
34  input.read(const_cast<char*>(outString.data()), size);
35  // close and return success
36  input.close();
37  return true;
38  } else {
39  return false;
40  }
41 }

+ Here is the caller graph for this function:

Variable Documentation

NullOutputStream torc::common::cnull

Global null output stream.

The torc::cnull stream can be used in place of std::cout, std::cerr, or std::clog.

Definition at line 26 of file NullOutputStream.cpp.