Skip to content

gh-94808: Improve coverage of dictresize - #100619

Merged
methane merged 1 commit into
python:mainfrom
tqxia:improve-dictresize-coverage
Dec 31, 2022
Merged

gh-94808: Improve coverage of dictresize#100619
methane merged 1 commit into
python:mainfrom
tqxia:improve-dictresize-coverage

Conversation

@tqxia

@tqxiatqxia commented Dec 30, 2022

Copy link
Copy Markdown
Contributor

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

Code covered:

if (mp->ma_keys->dk_kind==DICT_KEYS_GENERAL) {
// split -> generic
PyDictKeyEntry*newentries=DK_ENTRIES(mp->ma_keys);
for (Py_ssize_ti=0; i<numentries; i++) {
intindex=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
Copy Markdown

Most changes to Python require a NEWS entry.

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

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

ghost commented Dec 30, 2022

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@tqxia@bedevere-bot@methane@kumaraditya303