Skip to content

CFError: add a test suite for creation, accessors and equality#69

Open
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:test/cferror-coverage
Open

CFError: add a test suite for creation, accessors and equality#69
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:test/cferror-coverage

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CFError.c previously had almost no direct test coverage. This adds a self-contained CFError test suite (Tests/CFError) built on the existing CFTesting.h framework.

It exercises the public API:

  • CFErrorCreate — normal creation, the NULL-domain rejection, and the empty-dictionary substitution used when userInfo is NULL.
  • CFErrorCreateWithUserInfoKeysAndValues.
  • Accessors: CFErrorGetDomain, CFErrorGetCode, CFErrorCopyUserInfo.
  • Localized accessors: CFErrorCopyDescription, CFErrorCopyFailureReason, CFErrorCopyRecoverySuggestion.
  • CFErrorGetTypeID / CFGetTypeID.
  • Equality and hashing (CFEqual / CFHash) across matching, differing-code and differing-domain errors.

This raises CFError.c line coverage from 7.9% to 100% (measured with llvm-cov). All new tests pass and no existing tests are affected.

CFError.c had almost no direct coverage.  Add tests exercising the
public API: CFErrorCreate (including the NULL-domain rejection and the
absent-user-info substitution), CFErrorCreateWithUserInfoKeysAndValues,
the domain, code and user-info accessors, the localized description,
failure-reason and recovery-suggestion accessors, and CFEqual / CFHash
on errors.  Raises CFError.c line coverage from 7.9% to 100%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant