1 #include <cppunit/extensions/HelperMacros.h> //
2 #include "SPI_controler_top.h"
4 // 以下はSPIControlerTestクラスの宣言-----
5 class SPIControlerTest : public CPPUNIT_NS::TestFixture { //
6 CPPUNIT_TEST_SUITE( SPIControlerTest ); //
7 CPPUNIT_TEST( test_init ); //
8 CPPUNIT_TEST( test_incr ); //
9 CPPUNIT_TEST( test_clear ); //
10 CPPUNIT_TEST_SUITE_END(); //
25 // 以下はSPIControlerTestクラスの実装-----
26 CPPUNIT_TEST_SUITE_REGISTRATION( SPIControlerTest ); //
28 SPIControlerTest::SPIControlerTest( )
31 c_ = new SPIControlerTop();
34 SPIControlerTest::~SPIControlerTest( )
38 void SPIControlerTest::setUp() {
42 void SPIControlerTest::tearDown() {
47 void SPIControlerTest::test_init() {
51 CPPUNIT_ASSERT_EQUAL(0,(int) c_->read_MOSI()); //
54 void SPIControlerTest::test_incr() {
55 for ( int i = 1; i < 10; ++i ) {
56 CPPUNIT_ASSERT_EQUAL(i,(int) c_->read_MOSI()); //
60 void SPIControlerTest::test_clear() {
64 CPPUNIT_ASSERT_EQUAL(0,(int) c_->read_MOSI()); //