torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PadUnitTest.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 Pad class.
18 
19 #include <boost/test/unit_test.hpp>
21 
22 namespace torc {
23 namespace architecture {
24 
25 BOOST_AUTO_TEST_SUITE(architecture)
26 
27 /// \brief Unit test for the Pad class.
28 BOOST_AUTO_TEST_CASE(PadUnitTest) {
29  // members tested:
30  // SiteIndex mSiteIndex;
31  // string mName;
32  // SiteFlags mFlags;
33  // functions tested:
34  // Pad(SiteIndex inSiteIndex, const string& inName, SiteFlags inFlags);
35  // Pad(void);
36  // SiteIndex getSiteIndex(void) const;
37  // const string& getName(void) const;
38  // SiteFlags getFlags(void) const;
39  xilinx::SiteIndex siteIndex(15);
40  std::string name("name");
41  xilinx::SiteFlags flags(3);
42  Pad pad1(siteIndex, name, flags);
43  BOOST_CHECK_EQUAL(pad1.getSiteIndex(), siteIndex);
44  BOOST_CHECK_EQUAL(pad1.getName(), name);
45  BOOST_CHECK_EQUAL(pad1.getFlags(), flags);
46  Pad pad2;
47  BOOST_CHECK_EQUAL(pad2.getSiteIndex(), xilinx::SiteIndex());
48  BOOST_CHECK_EQUAL(pad2.getName(), "");
49  BOOST_CHECK_EQUAL(pad2.getFlags(), xilinx::SiteFlags());
50 }
51 
52 BOOST_AUTO_TEST_SUITE_END()
53 
54 } // namespace architecture
55 } // namespace torc
const string & getName(void) const
Returns the name of the pad in its physical package.
Definition: Pad.hpp:64
Encapsulation of the site index, pin name, and pin flags for a package.
Definition: Pad.hpp:33
BOOST_AUTO_TEST_CASE(ArcUnitTest)
Unit test for the Arc class.
Definition: ArcUnitTest.cpp:29
std::string string
Header for the Pad class.
SiteFlags getFlags(void) const
Returns the site flags for this pad, specifically including bonding.
Definition: Pad.hpp:66
Encapsulation of site attribute flags in an unsigned 16-bit integer.
Encapsulation of a site index in an unsigned 32-bit integer.
SiteIndex getSiteIndex(void) const
Returns the index of the site corresponding to this pad.
Definition: Pad.hpp:62