public void AssertNormsEquals(string info, IndexReader leftReader, IndexReader rightReader)
{
Fields leftFields = MultiFields.GetFields(leftReader);
Fields rightFields = MultiFields.GetFields(rightReader);
// Fields could be null if there are no postings,
// but then it must be null for both
if (leftFields == null || rightFields == null)
{
Assert.IsNull(leftFields, info);
Assert.IsNull(rightFields, info);
return;
}
foreach (string field in leftFields)
{
NumericDocValues leftNorms = MultiDocValues.GetNormValues(leftReader, field);
NumericDocValues rightNorms = MultiDocValues.GetNormValues(rightReader, field);
if (leftNorms != null && rightNorms != null)
{
AssertDocValuesEquals(info, leftReader.MaxDoc, leftNorms, rightNorms);
}
else
{
Assert.IsNull(leftNorms, info);
Assert.IsNull(rightNorms, info);
}
}
}