| 1 | // Copyright © 2004-2006 University of Helsinki, Department of Computer Science | |
| 2 | // Copyright © 2012 various contributors | |
| 3 | // This software is released under GNU Lesser General Public License 2.1. | |
| 4 | // The license text is at http://www.gnu.org/licenses/lgpl-2.1.html | |
| 5 | ||
| 6 | package fi.helsinki.cs.titokone.devices; | |
| 7 | ||
| 8 | import fi.helsinki.cs.titokone.IODevice; | |
| 9 | ||
| 10 | /** | |
| 11 | * a device which returns 0's and eats output | |
| 12 | */ | |
| 13 | public class ZeroIODevice | |
| 14 | implements IODevice { | |
| 15 | public int getPortCount() { | |
| 16 | 3 | return 1; |
| 17 | } | |
| 18 | ||
| 19 | @Override | |
| 20 | public int getPort(int n) { | |
| 21 | 1 | if (n == 0) { |
| 22 | 3 | return 0; |
| 23 | } | |
| 24 | 5 | throw new RuntimeException("should not be possible " + n); |
| 25 | } | |
| 26 | ||
| 27 | @Override | |
| 28 | public void setPort(int n, int value) { | |
| 29 | 1 | if (n != 0) { |
| 30 | 5 | throw new RuntimeException("should not be possible " + n); |
| 31 | } | |
| 32 | } | |
| 33 | ||
| 34 | public void reset() { | |
| 35 | } | |
| 36 | ||
| 37 | public void update() { | |
| 38 | } | |
| 39 | } | |
Mutations | ||
| 16 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : SURVIVED Substituted 1 with 0 : SURVIVED Substituted 1 with 0 : SURVIVED |
|
| 21 |
negated conditional : NO_COVERAGE |
|
| 22 |
Substituted 0 with 1 : NO_COVERAGE replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE Substituted 0 with 1 : NO_COVERAGE |
|
| 24 |
removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::toString : NO_COVERAGE removed call to java/lang/StringBuilder::<init> : NO_COVERAGE removed call to java/lang/RuntimeException::<init> : NO_COVERAGE |
|
| 29 |
negated conditional : NO_COVERAGE |
|
| 30 |
removed call to java/lang/StringBuilder::toString : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::<init> : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/RuntimeException::<init> : NO_COVERAGE |