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

Implementation of Replacement for Debug.Assert() that can be turned on/off in Release build (addresses #326) #327

Merged
merged 13 commits into from
Aug 24, 2020

Conversation

NightOwl888
Copy link
Contributor

This fixes #326

Debugging.Assert() overloads were created to replace Debug.Assert() so they don't get compiled out of production builds. In addition, the message parameter is a Func<string> so we don't have the performance impact (or errors) caused by building messages for succeeding asserts.

The task was expanded to include a workflow for turning off asserts when running tests. This is primarily to verify that the release build will function with asserts disabled, but can also be used to improve CI performance by reducing the amount of testing that happens.

…allow assertions to be turned on and off in the Release build
…ng.Assert() instead of System.Diagnostics.Debug.Assert()
…rt() instead of Lucene.Net.Diagnostics.Debug.Assert()
…ssert() instead of System.Diagnostics.Debug.Assert()
…tions to be not run when asserts are disabled
…xed issue with reflection not finding the method due to the Func<string> parameter of Debugging.Assert()
…n always instead of AssertionException only when assert is enabled
@NightOwl888 NightOwl888 merged commit e8bc15f into apache:master Aug 24, 2020
@NightOwl888 NightOwl888 added this to the 4.8.0-beta00012 milestone Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create replacement for Debug.Assert() that can be turned on/off in Release build
1 participant