TEST(EventListTest, testSize) { Event::List list; EXPECT_EQ(0, list.size()); Event event(0, EventType::NOTE); list.add(event); EXPECT_EQ(1, list.size()); }
TEST(EventListTest, testClear) { Event::List list; Event b(480, EventType::NOTE); Event a(0, EventType::NOTE); list.add(b, 14); list.add(a, 20); EXPECT_EQ(2, list.size()); EXPECT_EQ(20, list.get(0)->id); list.clear(); EXPECT_EQ(0, list.size()); }
TEST(EventListTest, testRemoveAt) { Event::List list; Event a(0, EventType::NOTE); Event b(0, EventType::NOTE); list.add(a, 100); list.add(b, 2); EXPECT_EQ(100, list.get(0)->id); EXPECT_EQ(2, list.get(1)->id); EXPECT_EQ(2, list.size()); list.removeAt(0); EXPECT_EQ(1, list.size()); EXPECT_EQ(2, list.get(0)->id); }
/** * @brief 反復子の次の要素を探索する * @return (int) 次のインデックス */ int _nextPosition() const{ int count = _list->size(); for( int i = _pos + 1; i < count; ++i ){ const Event *item = _list->get( i ); if( _kindSinger ){ if( item->type == EventType::SINGER ){ return i; } } if( _kindNote ){ if( item->type == EventType::NOTE ){ return i; } } if( _kindDynaff || _kindCrescend || _kindDecrescend ){ if( item->type == EventType::ICON && item->iconDynamicsHandle.getHandleType() != HandleType::UNKNOWN ) { if( _kindDynaff ){ if( item->iconDynamicsHandle.isDynaffType() ){ return i; } } if( _kindCrescend ){ if( item->iconDynamicsHandle.isCrescendType() ){ return i; } } if( _kindDecrescend ){ if( item->iconDynamicsHandle.isDecrescendType() ){ return i; } } } } } return -1; }
TEST(EventListTest, testConstruct) { Event::List list; EXPECT_EQ(0, list.size()); }