Key replacement should not update the dictionary's size.
This commit also adds a test for the bug.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit
29ec3156ee66b6e2553a0adb2f35cb143edddc5f)
value = qdict_get_int(tests_dict, key);
fail_unless(value == 2);
+
+ fail_unless(qdict_size(tests_dict) == 1);
}
END_TEST
/* allocate a new entry */
entry = alloc_entry(key, value);
QLIST_INSERT_HEAD(&qdict->table[hash], entry, next);
+ qdict->size++;
}
-
- qdict->size++;
}
/**