Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetDesiredFailureMsg() doesn't handle the same message added twice #87

Closed
karl-lunarg opened this issue May 14, 2018 · 0 comments
Closed
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@karl-lunarg
Copy link
Contributor

Issue by cdwfs (MIGRATED)
Friday May 04, 2018 at 13:42 GMT
Originally opened as KhronosGroup/Vulkan-LoaderAndValidationLayers#2639


I recently hit a few cases writing unit tests where the same error is emitted 2+ times by a single API call. I tried adding multiple calls to SetDesiredFailureMsg() with the same VUID, but everything after the first occurrence was still treated as an unexpected error. I'm not sure if this is the expected behavior or not; @chrisforbes was surprised to hear it didn't work, but if this is an intentional restriction, feel free to ignore; I can easily rework the tests to emit multiple errors 1x times apiece.

Details: the messages / message IDs are inserted into a std::unordered_set, and a count is incremented. Adding a duplicate message has no effect on the set contents, but the count is still incremented. The first time the message is encountered, it's removed from the set, causing subsequent appearances to be treated as unexpected errors. If duplicate messages should be allowed, one possibility would be to replace the unordered_set a std::map<ID, count> or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants