Skip to content

Conversation

tqxia
Copy link
Contributor

@tqxia tqxia commented Dec 30, 2022

Try to improve test coverage for Objects/dictobject.c, adding the case "converting a split table into a generic combined table".

Code covered:

cpython/Objects/dictobject.c

Lines 1439 to 1452 in 894f2c3

if (mp->ma_keys->dk_kind == DICT_KEYS_GENERAL) {
// split -> generic
PyDictKeyEntry *newentries = DK_ENTRIES(mp->ma_keys);
for (Py_ssize_t i = 0; i < numentries; i++) {
int index = get_index_from_order(mp, i);
PyDictUnicodeEntry *ep = &oldentries[index];
assert(oldvalues->values[index] != NULL);
newentries[i].me_key = Py_NewRef(ep->me_key);
newentries[i].me_hash = unicode_get_hash(ep->me_key);
newentries[i].me_value = oldvalues->values[index];
}
build_indices_generic(mp->ma_keys, newentries, numentries);
}

Issue:
#94808

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Dec 30, 2022
@ghost
Copy link

ghost commented Dec 30, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants