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クラスの実装-----
27 CPPUNIT_TEST_SUITE_REGISTRATION( SPIControlerTest ); //
30 void SPIControlerTest::setUp() {
31 c_ = new SPIControlerTop();
35 void SPIControlerTest::tearDown() {
41 void SPIControlerTest::test_init() {
42 CPPUNIT_ASSERT_EQUAL(0,(int) c_->read_MOSI()); //
45 void SPIControlerTest::test_incr() {
46 for ( int i = 1; i < 10; ++i ) {
47 CPPUNIT_ASSERT_EQUAL(i,(int) c_->read_MOSI()); //
51 void SPIControlerTest::test_clear() {
52 CPPUNIT_ASSERT_EQUAL(0,(int) c_->read_MOSI()); //