@Test public void testSplitShouldNotBePossible() throws Exception { final String program = "#version 100\nvoid main() { for(int i = 0; i < 10; i++) { if(true) " + "break; } }"; final TranslationUnit tu = ParseHelper.parse(program); assertEquals(1, countForLoops(tu)); new SplitForLoopTransformation().apply(tu, TransformationProbabilities.onlySplitLoops(), new RandomWrapper(0), GenerationParams.normal(ShaderKind.FRAGMENT, true)); assertEquals(1, countForLoops(tu)); }
@Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { List<SplitForLoopMutation> splitForLoopMutations = new SplitForLoopMutationFinder(tu, generator) .findMutations(probabilities::splitLoops, generator); for (SplitForLoopMutation mutation : splitForLoopMutations) { mutation.apply(); } return !splitForLoopMutations.isEmpty(); }
SplitForLoopTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { List<SplitForLoopMutation> splitForLoopMutations = new SplitForLoopMutationFinder(tu, generator) .findMutations(probabilities::splitLoops, generator); for (SplitForLoopMutation mutation : splitForLoopMutations) { mutation.apply(); } return !splitForLoopMutations.isEmpty(); } }
SplitForLoopTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { List<SplitForLoopMutation> splitForLoopMutations = new SplitForLoopMutationFinder(tu, generator) .findMutations(probabilities::splitLoops, generator); for (SplitForLoopMutation mutation : splitForLoopMutations) { mutation.apply(); } return !splitForLoopMutations.isEmpty(); }  }
SplitForLoopTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { List<SplitForLoopMutation> splitForLoopMutations = new SplitForLoopMutationFinder(tu, generator) .findMutations(probabilities::splitLoops, generator); for (SplitForLoopMutation mutation : splitForLoopMutations) { mutation.apply(); } return !splitForLoopMutations.isEmpty(); }  @Override boolean apply(TranslationUnit tu,
                       TransformationProbabilities probabilities,
                       IRandom generator,
                       GenerationParams generationParams); @Override String getName(); }
SplitForLoopTransformation implements ITransformation { @Override public boolean apply(TranslationUnit tu, TransformationProbabilities probabilities, IRandom generator, GenerationParams generationParams) { List<SplitForLoopMutation> splitForLoopMutations = new SplitForLoopMutationFinder(tu, generator) .findMutations(probabilities::splitLoops, generator); for (SplitForLoopMutation mutation : splitForLoopMutations) { mutation.apply(); } return !splitForLoopMutations.isEmpty(); }  @Override boolean apply(TranslationUnit tu,
                       TransformationProbabilities probabilities,
                       IRandom generator,
                       GenerationParams generationParams); @Override String getName(); static final String NAME; }