torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DDBStreamHelperUnitTest.cpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Unit test for the DDBStreamHelper class.
18 
19 #include <boost/test/unit_test.hpp>
23 #include <sstream>
24 
25 namespace torc {
26 namespace architecture {
27 
28 using namespace torc::architecture::xilinx;
29 
30 BOOST_AUTO_TEST_SUITE(architecture)
31 
32 /// \brief Unit test for the DDBStreamHelper class.
33 BOOST_AUTO_TEST_CASE(DDBStreamHelperUnitTest) {
34  // functions tested:
35  // std::ostream& operator <<(std::ostream& os, const class DDB& ddb);
36  // static const class DDB* getDDBPtr(std::ostream& os);
37  DDB ddb("xc2vp2");
38  std::stringstream s;
39  s << ddb;
40  BOOST_CHECK(DDBStreamHelper::getDDBPtr(s) == &ddb);
41 
42  // functions tested:
43  // std::ostream& operator <<(std::ostream& os, const DDB& ddb);
44  // std::ostream& operator <<(std::ostream& os, const Tilewire& rhs);
45  s << ddb << Tilewire(TileIndex(1), WireIndex(0));
46  BOOST_CHECK_EQUAL(s.str(), "CNR_TBTERM_N6A1@[0,1] CNR_TTERM \"LIOITTERM\" (0@1)");
47 }
48 
49 BOOST_AUTO_TEST_SUITE_END()
50 
51 } // namespace architecture
52 } // namespace torc
Encapsulation of a tile index in an unsigned 32-bit integer.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
Header for the DDBStreamHelper class.
Encapsulation of a wire index in an unsigned 16-bit integer.
BOOST_AUTO_TEST_CASE(TilewireUnitTest)
Unit test for the Tilewire class.
static const class DDB * getDDBPtr(std::ostream &os)
Return the device database pointer associated with this stream.
Header for torc::physical output stream helpers.
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
Header for the DDB class.