本文整理汇总了C++中meta::TrackPtr::removeLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackPtr::removeLabel方法的具体用法?C++ TrackPtr::removeLabel怎么用?C++ TrackPtr::removeLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meta::TrackPtr
的用法示例。
在下文中一共展示了TrackPtr::removeLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCOMPARE
void
TestSqlTrack::testRemoveLabelFromTrack()
{
Meta::TrackPtr track = m_collection->registry()->getTrack( "/IDoNotExist.mp3" );
Meta::LabelPtr label = m_collection->registry()->getLabel( "A" );
track->addLabel( label );
QCOMPARE( track->labels().count(), 1 );
track->removeLabel( label );
QCOMPARE( track->labels().count(), 0 );
QStringList urlsLabelsCount = m_storage->query( "SELECT COUNT(*) FROM urls_labels;" );
QCOMPARE( urlsLabelsCount.first().toInt(), 0 );
}
示例2: labels
void
TestSqlTrack::testRemoveLabelFromTrackWhenNotInCache()
{
m_storage->query( "INSERT INTO labels(id,label) VALUES (1,'A');" );
m_storage->query( "INSERT INTO urls_labels(url,label) VALUES (1,1);" );
Meta::TrackPtr track = m_collection->registry()->getTrack( "/IDoNotExist.mp3" );
Meta::LabelPtr label = m_collection->registry()->getLabel( "A" );
track->removeLabel( label );
QCOMPARE( track->labels().count(), 0 );
QStringList urlsLabelsCount = m_storage->query( "SELECT COUNT(*) FROM urls_labels;" );
QCOMPARE( urlsLabelsCount.first().toInt(), 0 );
}