void tst_Q3ValueVector::clear() { Q3ValueVector<int> a; a.clear(); QVERIFY( a.empty() ); a.push_back( 1 ); a.push_back( 2 ); a.clear(); QVERIFY( a.empty() ); }
void tst_Q3ValueVector::resize() { Q3ValueVector<int> a; a.resize( 2 ); QVERIFY( a.size() == 2 ); Q3ValueVector<int> b; b.resize( 2, 42 ); QVERIFY( b.size() == 2 ); QCOMPARE( b[0], 42 ); QCOMPARE( b[1], 42 ); b.resize( 1 ); QVERIFY( b.size() == 1 ); b.resize( 4, 21 ); QCOMPARE( b[0], 42 ); QCOMPARE( b[1], 21 ); QCOMPARE( b[2], 21 ); QCOMPARE( b[3], 21 ); b.resize( 0 ); QVERIFY( b.empty() ); }
void tst_Q3ValueVector::pop_back() { Q3ValueVector<int> a; a.push_back( 1 ); a.push_back( 2 ); a.pop_back(); QVERIFY( a.back() == 1 && a.size() == 1 ); a.pop_back(); QVERIFY( a.empty() ); }
void tst_Q3ValueVector::empty() { Q3ValueVector<int> a; QVERIFY( a.empty() ); }