tst_qmapthreadsafety.cpp 549 B

12345678910111213
  1. #include "tst_qmapthreadsafety.h"
  2. void TST_QMapThreadSafety::test()
  3. {
  4. CWF::QMapThreadSafety<int, QString> myMap;
  5. QVERIFY2(myMap.insert(1, "First").key() == 1, "Should return 1");
  6. QVERIFY2(myMap.insert(2, "Second").key() == 2, "Should return 2");
  7. QVERIFY2(myMap.size() == 2, "Should return 2");
  8. QVERIFY2(myMap.contains(1) == true, "Should return true");
  9. QVERIFY2(myMap.remove(1) > 0, "Should return > 0");
  10. QVERIFY2(myMap.size() == 1, "Should return 1");
  11. QVERIFY2(myMap.contains(1) == false, "Should return false");
  12. }