00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/architecture/PadUnitTest.cpp $ 00003 // $Id: PadUnitTest.cpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Unit test for the Pad class. 00018 00019 #include <boost/test/unit_test.hpp> 00020 #include "torc/architecture/Pad.hpp" 00021 00022 namespace torc { 00023 namespace architecture { 00024 00025 BOOST_AUTO_TEST_SUITE(architecture) 00026 00027 /// \brief Unit test for the Pad class. 00028 BOOST_AUTO_TEST_CASE(PadUnitTest) { 00029 // members tested: 00030 // SiteIndex mSiteIndex; 00031 // string mName; 00032 // SiteFlags mFlags; 00033 // functions tested: 00034 // Pad(SiteIndex inSiteIndex, const string& inName, SiteFlags inFlags); 00035 // Pad(void); 00036 // SiteIndex getSiteIndex(void) const; 00037 // const string& getName(void) const; 00038 // SiteFlags getFlags(void) const; 00039 xilinx::SiteIndex siteIndex(15); 00040 std::string name("name"); 00041 xilinx::SiteFlags flags(3); 00042 Pad pad1(siteIndex, name, flags); 00043 BOOST_CHECK_EQUAL(pad1.getSiteIndex(), siteIndex); 00044 BOOST_CHECK_EQUAL(pad1.getName(), name); 00045 BOOST_CHECK_EQUAL(pad1.getFlags(), flags); 00046 Pad pad2; 00047 BOOST_CHECK_EQUAL(pad2.getSiteIndex(), xilinx::SiteIndex()); 00048 BOOST_CHECK_EQUAL(pad2.getName(), ""); 00049 BOOST_CHECK_EQUAL(pad2.getFlags(), xilinx::SiteFlags()); 00050 } 00051 00052 BOOST_AUTO_TEST_SUITE_END() 00053 00054 } // namespace architecture 00055 } // namespace torc