diff --git a/src/main/java/de/monticore/lang/monticar/cnnarch/caffe2generator/CNNArch2Caffe2.java b/src/main/java/de/monticore/lang/monticar/cnnarch/caffe2generator/CNNArch2Caffe2.java index d0bbb468c9abd0172f09cc0e5631c1aa55a31cd8..336e1086bac7f040fa6034b6607b01f6710c0214 100644 --- a/src/main/java/de/monticore/lang/monticar/cnnarch/caffe2generator/CNNArch2Caffe2.java +++ b/src/main/java/de/monticore/lang/monticar/cnnarch/caffe2generator/CNNArch2Caffe2.java @@ -26,7 +26,6 @@ import de.monticore.lang.monticar.cnnarch._cocos.CNNArchCocos; import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureSymbol; import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureElementSymbol; import de.monticore.lang.monticar.cnnarch._symboltable.CompositeElementSymbol; -import de.monticore.lang.monticar.cnnarch._symboltable.LayerSymbol; import de.monticore.lang.monticar.cnnarch._symboltable.CNNArchCompilationUnitSymbol; import de.monticore.lang.monticar.cnnarch._symboltable.CNNArchLanguage; import de.monticore.lang.monticar.generator.FileContent; @@ -51,8 +50,7 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{ private boolean isSupportedLayer(ArchitectureElementSymbol element, LayerSupportChecker layerChecker){ List constructLayerElemList; - //first part of if condition ensures that element is not an IOSymbol - if (element instanceof LayerSymbol && (element.getResolvedThis().get() instanceof CompositeElementSymbol)) { + if (element.getResolvedThis().get() instanceof CompositeElementSymbol) { constructLayerElemList = ((CompositeElementSymbol)element.getResolvedThis().get()).getElements(); for (ArchitectureElementSymbol constructedLayerElement : constructLayerElemList) { if (!isSupportedLayer(constructedLayerElement, layerChecker)) { diff --git a/src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java b/src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java index 9b09c53bc101e44568fe20e6555b86826dc3375f..fb07e78f421c34955ca79fe4dc80c58f8c61239a 100644 --- a/src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java +++ b/src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java @@ -136,8 +136,13 @@ public class GenerationTest extends AbstractSymtabTest{ public void testMultipleOutputs() throws IOException, TemplateException { Log.getFindings().clear(); String[] args = {"-m", "src/test/resources/valid_tests", "-r", "MultipleOutputs"}; + exit.expectSystemExit(); + exit.checkAssertionAfterwards(new Assertion() { + public void checkAssertion() { + assertTrue(Log.getFindings().size() == 2); + } + }); CNNArch2Caffe2Cli.main(args); - assertTrue(Log.getFindings().size() == 3); } @Test