tests/auto/qhash/tst_qhash.cpp
changeset 29 b72c6db6890b
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
25:e24348a560a6 29:b72c6db6890b
  1152 
  1152 
  1153     i = hash1.find(9, 98);
  1153     i = hash1.find(9, 98);
  1154     QVERIFY(i.key() == 9);
  1154     QVERIFY(i.key() == 9);
  1155     QVERIFY(i.value() == 98);
  1155     QVERIFY(i.value() == 98);
  1156     }
  1156     }
       
  1157 
       
  1158     {
       
  1159     QMultiHash<int, int> map1;
       
  1160     map1.insert(42, 1);
       
  1161     map1.insert(10, 2);
       
  1162     map1.insert(48, 3);
       
  1163     QMultiHash<int, int> map2;
       
  1164     map2.insert(8, 4);
       
  1165     map2.insert(42, 5);
       
  1166     map2.insert(95, 12);
       
  1167 
       
  1168     map1+=map2;
       
  1169     map2.insert(42, 1);
       
  1170     map2.insert(10, 2);
       
  1171     map2.insert(48, 3);
       
  1172     QCOMPARE(map1.count(), map2.count());
       
  1173     QVERIFY(map1.remove(42,5));
       
  1174     QVERIFY(map2.remove(42,5));
       
  1175     QVERIFY(map1 == map2);
       
  1176     }
  1157 }
  1177 }
  1158 
  1178 
  1159 template <typename T>
  1179 template <typename T>
  1160 QList<T> sorted(const QList<T> &list)
  1180 QList<T> sorted(const QList<T> &list)
  1161 {
  1181 {