diff options
| author | J08nY | 2017-11-05 16:48:30 +0100 |
|---|---|---|
| committer | J08nY | 2017-11-05 16:48:30 +0100 |
| commit | daaa7abd91ff8ae12e0b1835045489acbda0539f (patch) | |
| tree | 1a2a944473285359a9af3691f2ce69b608264f12 /src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java | |
| parent | 16f20afbff36a7e048d24d7e7d1db8657f002c5e (diff) | |
| download | ECTester-daaa7abd91ff8ae12e0b1835045489acbda0539f.tar.gz ECTester-daaa7abd91ff8ae12e0b1835045489acbda0539f.tar.zst ECTester-daaa7abd91ff8ae12e0b1835045489acbda0539f.zip | |
Implement Result.ExpectedValue to add more logic to test evaluation.
- Introduces a new enum Result.ExpectedValue, which is used to
signify what Test results are expected.
- Changes the Result.Value enum to contain information about what
was expected. It gains more values:
- UXSUCCESS -> Unexpected success.
- XFAILURE -> Expected failure.
The values SUCCESS and XFAILURE are the OK, values.
- Creates a hierarchy of evaluating Responses, Simple tests and
Compoung tests.
Simple test evaluates the OK property of the response object
(using .successfull() method) and again exposes its OK property
which depends on the tests ExpectedValue and the response
success.
Compound test evaluates the OK property of the Simple tests it
contains (using the .ok() method) and again exposes its OK
property which depends on the concrete Compound test variant,
but involves some ExpectedValues and the success of the individual
Simple tests it contains.
Diffstat (limited to '')
| -rw-r--r-- | src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java b/src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java index 20cb405..e9389b4 100644 --- a/src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java +++ b/src/cz/crcs/ectester/reader/test/WrongCurvesSuite.java @@ -7,6 +7,8 @@ import javacard.security.KeyPair; import java.io.IOException; +import static cz.crcs.ectester.reader.test.Result.ExpectedValue; + /** * @author Jan Jancar johny@neuromancer.sk */ @@ -23,10 +25,10 @@ public class WrongCurvesSuite extends TestSuite { */ String desc = "Default tests over wrong curve params."; if (cfg.primeField) { - tests.addAll(defaultCategoryTests(cardManager, cfg.testSuite, KeyPair.ALG_EC_FP, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, desc)); + tests.addAll(defaultCategoryTests(cardManager, cfg.testSuite, KeyPair.ALG_EC_FP, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, desc)); } if (cfg.binaryField) { - tests.addAll(defaultCategoryTests(cardManager, cfg.testSuite, KeyPair.ALG_EC_F2M, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, Result.Value.FAILURE, desc)); + tests.addAll(defaultCategoryTests(cardManager, cfg.testSuite, KeyPair.ALG_EC_F2M, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, ExpectedValue.FAILURE, desc)); } } } |
