Skip to content

Commit 3131266

Browse files
committed
Interlace dummy output symbols in the input sequence so trace does not
skip inputs
1 parent 3277056 commit 3131266

File tree

1 file changed

+7
-1
lines changed
  • src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core

1 file changed

+7
-1
lines changed

src/main/java/com/github/protocolfuzzing/protocolstatefuzzer/statefuzzer/testrunner/core/TestRunnerRA.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
import java.io.IOException;
2727
import java.util.ArrayList;
2828
import java.util.Arrays;
29+
import java.util.Iterator;
2930
import java.util.List;
31+
import java.util.stream.Stream;
3032
/**
3133
* The standard implementation of the TestRunner Interface.
3234
*
@@ -200,18 +202,22 @@ protected List<TestRunnerResult<Word<PSymbolInstance>, Word<PSymbolInstance>>> r
200202
// This is most likely unintended since it is a wrapper around WordBuilder which is public.
201203
// Using that would allow us to skip using WordBuilder directly.
202204
// TODO: Open an issue or otherwise notify about this.
205+
LOGGER.debug("Read mealy tests: {}", tests);
203206
WordBuilder<PSymbolInstance> wordBuilder = new WordBuilder<>();
204207
List<Word<PSymbolInstance>> convertedTests = new ArrayList<>(tests.size());
208+
PSymbolInstance placeholderElement = new PSymbolInstance(new OutputSymbol("PLACEHOLDER ELEMENT"));
209+
Iterator<PSymbolInstance> placeholders = Stream.iterate(placeholderElement, i -> placeholderElement).iterator();
205210
for (Word<I> test : tests) {
206211
List<PSymbolInstance> wordList = test.stream()
207212
.map(inputTransformer::toTransformedInput)
208213
.map(p -> new PSymbolInstance(p))
214+
.flatMap(x -> Stream.of(x, placeholders.next()))
209215
.toList();
210216
Word<PSymbolInstance> pWord = wordBuilder.append(wordList).toWord();
211217
convertedTests.add(pWord);
212218
wordBuilder.clear();
213-
214219
}
220+
LOGGER.debug("Converted tests: {}", convertedTests);
215221

216222

217223
List<

0 commit comments

Comments
 (0)