more test fixes

This commit is contained in:
Grahame Grieve 2019-02-08 17:52:37 +11:00
parent a04b900054
commit f5c592fbad
2 changed files with 4 additions and 3 deletions

View File

@ -3119,8 +3119,8 @@ public class ProfileUtilities extends TranslatingUtilities {
public void sortDifferential(StructureDefinition base, StructureDefinition diff, String name, List<String> errors) throws FHIRException {
final List<ElementDefinition> diffList = diff.getDifferential().getElement();
int lastCount = diffList.size();
// first, we move the differential elements into a tree
if (diffList.isEmpty())
return;
@ -3160,6 +3160,9 @@ public class ProfileUtilities extends TranslatingUtilities {
// now, we serialise them back to a list
diffList.clear();
writeElements(edh, diffList);
if (lastCount != diffList.size())
errors.add("Sort failed: counts differ; at least one of the paths in the differential is illegal");
}
private int processElementsIntoTree(ElementDefinitionHolder edh, int i, List<ElementDefinition> list) {

View File

@ -344,8 +344,6 @@ public class SnapShotGenerationTests {
pu.sortDifferential(base, output, source.getName(), errors);
if (errors.size() > 0)
throw new FHIRException("Sort failed: "+errors.toString());
if (lastCount != output.getDifferential().getElement().size())
throw new FHIRException("Sort failed: counts differ; at least one of the paths in the differential is illegal");
}
pu.generateSnapshot(base, output, source.getUrl(), source.getName());