diff --git a/androidTests/app/src/main/java/com/pep/k9/MainActivity.java b/androidTests/app/src/main/java/com/pep/k9/MainActivity.java index 754be8a..0b6d0e3 100644 --- a/androidTests/app/src/main/java/com/pep/k9/MainActivity.java +++ b/androidTests/app/src/main/java/com/pep/k9/MainActivity.java @@ -46,10 +46,10 @@ public class MainActivity extends AppCompatActivity { //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { try { - testPEpTypes(); + //testPEpTypes(); testPEpAliceBobJohn(); - testKeyserverLookup(); - testKeyGen(); + //testKeyserverLookup(); + //testKeyGen(); } catch (Exception ex) { Log.e("PEPTEST", "##################### TEST Exception ####################",ex); @@ -437,6 +437,29 @@ public class MainActivity extends AppCompatActivity { to.add(bob); msg.setTo(to); + msg.setShortmsg("hello, world"); + msg.setLongmsg("this is a test"); + + msg.setDir(Message.Direction.Outgoing); + Color aclr = e.outgoing_message_color(msg); + if(!(aclr.equals(Color.pEpRatingReliable))) throw new AssertionError(); + + e.trustPersonalKey(bob); + Color bclr = e.outgoing_message_color(msg); + if(!(bclr.equals(Color.pEpRatingTrusted))) throw new AssertionError(); + + e.keyResetTrust(bob); + Color cclr = e.outgoing_message_color(msg); + if(!(cclr.equals(Color.pEpRatingReliable))) throw new AssertionError(); + + e.keyCompromized(bob); + Color dclr = e.outgoing_message_color(msg); + if(!(dclr.equals(Color.pEpRatingUnencrypted))) throw new AssertionError(); + + e.keyResetTrust(bob); + Color oclr = e.outgoing_message_color(msg); + if(!(oclr.equals(Color.pEpRatingReliable))) throw new AssertionError(); + Vector cc = new Vector(); cc.add(alice); msg.setCc(cc); @@ -445,9 +468,6 @@ public class MainActivity extends AppCompatActivity { bcc.add(john); msg.setBcc(bcc); - msg.setShortmsg("hello, world"); - msg.setLongmsg("this is a test"); - { ArrayList> pairs = new ArrayList>(); pairs.add(new Pair("Received","in time")); @@ -485,7 +505,6 @@ public class MainActivity extends AppCompatActivity { msg.setAttachments(attachments); } - msg.setDir(Message.Direction.Outgoing); if(!(e.outgoing_message_color(msg).equals(Color.pEpRatingReliable))) throw new AssertionError(); Message enc = null; @@ -505,13 +524,6 @@ public class MainActivity extends AppCompatActivity { if(!(result.dst.getShortmsg().equals("hello, world"))) throw new AssertionError(); if(!(result.dst.getLongmsg().equals("this is a test"))) throw new AssertionError(); - /* TODO - if(!(result.color.equals(Color.pEpRatingReliable))) throw new AssertionError(); - e.trustPersonalKey(john); - e.keyResetTrust(john); - e.keyCompromized(john); - */ - ArrayList> _pairs = result.dst.getOptFields(); /* FIXME ? { diff --git a/src/pEp.yml2 b/src/pEp.yml2 index 4e11df3..082a890 100644 --- a/src/pEp.yml2 +++ b/src/pEp.yml2 @@ -64,9 +64,10 @@ namespace pEp { pEp_rating_trusted_and_anonymized > 7 pEp_rating_fully_anonymous > 8 - pEp_rating_under_attack > -1 + pEp_rating_mistrust > -1 pEp_rating_red > -1 pEp_rating_b0rken > -2 + pEp_rating_under_attack > -3 }; interface Engine {