Fix for .NET Framework x86 Support #529
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #269.
This fixes the following tests so they don't fail on .NET Framework x86 with optimizations enabled (without working around the problem by disabling optimizations):
Failed due to cast from
float
todouble
causing a change of valueLucene.Net.Expressions.TestExpressionSorts::TestQueries()
This was fixed by adding an intermediate cast to
decimal
on .NET Framework and .NET Standard 2.0 onlyFailed due to equality comparisons between float data type values
Lucene.Net.Sandbox.TestSlowFuzzyQuery::TestTieBreaker()
Lucene.Net.Sandbox.TestSlowFuzzyQuery::TestTokenLengthOpt()
Lucene.Net.Search.TestBooleanQuery::TestBS2DisjunctionNextVsAdvance()
Lucene.Net.Search.TestFuzzyQuery::TestTieBreaker()
Lucene.Net.Search.TestSearchAfter::TestQueries()
Lucene.Net.Search.TestTopDocsMerge::TestSort_1()
Lucene.Net.Search.TestTopDocsMerge::TestSort_2()
These were fixed by using the
Lucene.Net.Util.NumericUtils::SingleToSortableInt32()
method to compare the raw bits for equality. This change doesn't impact performance or behavior of the application as using an approximate float comparison would.This also fixes Lucene.Net.Expressions.ExpressionComparer to use
J2N.Collections.Generic.Comparer<double>
to ensure we use the same floating point comparison logic as Java.