Never reuse contact IDs.

This commit is contained in:
akwizgran
2011-10-19 12:43:44 +01:00
parent c8b2cc38de
commit dbdbb1d8d4
3 changed files with 22 additions and 19 deletions

View File

@@ -186,9 +186,9 @@ public class H2DatabaseTest extends TestCase {
assertFalse(db.containsContact(txn, contactId2));
assertEquals(contactId2, db.addContact(txn, transports, secret));
assertTrue(db.containsContact(txn, contactId2));
// Delete one of the contacts
db.removeContact(txn, contactId1);
assertFalse(db.containsContact(txn, contactId1));
// Delete the contact with the highest ID
db.removeContact(txn, contactId2);
assertFalse(db.containsContact(txn, contactId2));
// Add another contact - a new ID should be created
assertFalse(db.containsContact(txn, contactId3));
assertEquals(contactId3, db.addContact(txn, transports, secret));