summaryrefslogtreecommitdiff
path: root/lib/variables.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-08-02 14:55:02 -0400
committerPeter Jones <pjones@redhat.com>2021-09-07 17:05:04 -0400
commit1f434aa623420f9768c327229053841d4fc904c0 (patch)
tree3916a26f966aee0f16ef13ad0ae3964add9fc22b /lib/variables.c
parent284f30607aaaab3a8ad502c557e31f7f5dbc0b64 (diff)
downloadefi-boot-shim-1f434aa623420f9768c327229053841d4fc904c0.tar.gz
efi-boot-shim-1f434aa623420f9768c327229053841d4fc904c0.zip
tests: make the CompareGuid() comparison size be less stupid
5f08e671e4eb introduced a CompareGuid() call in the unit test harness, but unfortunately it has a typo and thus only ever compares the first pointer-sized word of the guid. With 4-GUIDs, this will usually produce the correct results; with 1-GUIDs it often won't. A second issue is that the memcmp() implementation of CompareGuid() produces a different sort order than comparing field-by-field, and also a different sort order than comparing the string representation. This is often not a problem (edk2, for example, never compares anything except equality of two GUIDs), but when writing test cases it is extremely helpful to be able to look at a list that is sorted in an intuitive order. This patch introduces a guidcmp() function in the test suite, which compares the binary data in the same order that comparing the two GUIDs' string representations would. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'lib/variables.c')
0 files changed, 0 insertions, 0 deletions