Browse Source

Tests: make setting fpr an explicit choice for the new world order in preset-world

IPS-2
Krista Bennett 12 months ago
parent
commit
4db5c9dfc7
14 changed files with 95 additions and 93 deletions
  1. +10
    -10
      test/src/AsciiBinaryAtt998Test.cc
  2. +8
    -8
      test/src/DefaultFromEmailTest.cc
  3. +16
    -16
      test/src/EmptyLongmsgFullHtmlTest.cc
  4. +6
    -6
      test/src/Engine514Test.cc
  5. +2
    -2
      test/src/Engine704Test.cc
  6. +1
    -1
      test/src/GetKeyRatingForUserTest.cc
  7. +9
    -9
      test/src/IsOwnKeyTest.cc
  8. +7
    -7
      test/src/KeyResetMessageTest.cc
  9. +19
    -19
      test/src/Message2_1Test.cc
  10. +5
    -5
      test/src/ReencryptPlusExtraKeysTest.cc
  11. +5
    -5
      test/src/TestSetDefaultFPRTest.cc
  12. +3
    -3
      test/src/UnencryptedPepMailTest.cc
  13. +2
    -1
      test/src/test_util.cc
  14. +2
    -1
      test/src/test_util.h

+ 10
- 10
test/src/AsciiBinaryAtt998Test.cc View File

@ -86,14 +86,14 @@ namespace {
TEST_F(AsciiBinary998Test, check_engine_895) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice, nullptr);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, true, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, true, true, true, true, false, true, &alice_is_bob);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice_is_bob, nullptr);
alice_is_bob->user_id = strdup(alice->user_id);
@ -177,14 +177,14 @@ TEST_F(AsciiBinary998Test, check_engine_895) {
TEST_F(AsciiBinary998Test, check_increasing_attachment_size_mime_encode) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice, nullptr);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, true, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, true, true, true, true, false, true, &alice_is_bob);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice_is_bob, nullptr);
alice_is_bob->user_id = strdup(alice->user_id);
@ -218,14 +218,14 @@ TEST_F(AsciiBinary998Test, check_increasing_attachment_size_mime_encode) {
TEST_F(AsciiBinary998Test, check_997_strings_in_attachment) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice, nullptr);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, true, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, true, true, true, true, false, true, &alice_is_bob);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice_is_bob, nullptr);
alice_is_bob->user_id = strdup(alice->user_id);
@ -267,14 +267,14 @@ TEST_F(AsciiBinary998Test, check_997_strings_in_attachment) {
TEST_F(AsciiBinary998Test, check_big_plaintext_998) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice, nullptr);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, true, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, true, true, true, true, false, true, &alice_is_bob);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice_is_bob, nullptr);
alice_is_bob->user_id = strdup(alice->user_id);
@ -306,14 +306,14 @@ TEST_F(AsciiBinary998Test, check_big_plaintext_998) {
TEST_F(AsciiBinary998Test, check_big_plaintext_999) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice, nullptr);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, true, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, true, true, true, true, false, true, &alice_is_bob);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NE(alice_is_bob, nullptr);
alice_is_bob->user_id = strdup(alice->user_id);


+ 8
- 8
test/src/DefaultFromEmailTest.cc View File

@ -81,11 +81,11 @@ namespace {
void create_base_test_msg(message** msg, unsigned int to_major, unsigned int to_minor, bool is_pEp) {
pEp_identity* from = NULL;
PEP_STATUS status = set_up_preset(session, JOHN, true, true, true, true, true, &from);
PEP_STATUS status = set_up_preset(session, JOHN, true, true, true, true, true, true, &from);
ASSERT_OK;
pEp_identity* to = NULL;
status = set_up_preset(session, INQUISITOR, true, is_pEp, false, false, false, &to);
status = set_up_preset(session, INQUISITOR, true, true,is_pEp, false, false, false, &to);
ASSERT_OK;
to->major_ver = to_major;
to->minor_ver = to_minor;
@ -467,7 +467,7 @@ TEST_F(DefaultFromEmailTest, check_to_to_OpenPGP_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;
@ -513,7 +513,7 @@ TEST_F(DefaultFromEmailTest, check_to_pEp_v1_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;
@ -558,7 +558,7 @@ TEST_F(DefaultFromEmailTest, check_to_pEp_v2_0_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;
@ -603,7 +603,7 @@ TEST_F(DefaultFromEmailTest, check_to_pEp_v2_1_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;
@ -648,7 +648,7 @@ TEST_F(DefaultFromEmailTest, check_to_pEp_v2_2_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;
@ -693,7 +693,7 @@ TEST_F(DefaultFromEmailTest, check_to_pEp_v10_111_import_bare_default) {
ASSERT_NOTNULL(enc_msg);
pEp_identity* me = NULL;
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, &me);
status = set_up_preset(session, INQUISITOR, true, true, true, true, true, true, &me);
ASSERT_OK;
message* dec_msg = NULL;


+ 16
- 16
test/src/EmptyLongmsgFullHtmlTest.cc View File

@ -123,9 +123,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_NULL) {
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -144,9 +144,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_att) {
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -170,9 +170,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_html_att) {
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -198,9 +198,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_html_atts) {
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -240,9 +240,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_html_atts) {
TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_html_text_atts) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -282,9 +282,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_empty) {
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -304,9 +304,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_inline_att)
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;
@ -353,9 +353,9 @@ TEST_F(EmptyLongmsgFullHtmlTest, check_empty_longmsg_full_html_text_inline_att_p
// This is just a dummy test case. The convention is check_whatever_you_are_checking
// so for multiple test cases in a suite, be more explicit ;)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
message* msg = new_message(PEP_dir_outgoing);
msg->from = carol;


+ 6
- 6
test/src/Engine514Test.cc View File

@ -99,7 +99,7 @@ TEST_F(Engine514Test, check_engine514_unencrypted) {
message* msg = new_message(PEP_dir_outgoing);
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
status = myself(session, carol);
@ -150,7 +150,7 @@ TEST_F(Engine514Test, check_engine514_unencrypted_second_position) {
message* msg = new_message(PEP_dir_outgoing);
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
status = myself(session, carol);
@ -199,14 +199,14 @@ TEST_F(Engine514Test, check_engine514_encode_and_decode) {
message* msg = new_message(PEP_dir_outgoing);
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
status = myself(session, carol);
ASSERT_EQ(status, PEP_STATUS_OK);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
msg->from = carol;
msg->to = new_identity_list(dave);
msg->shortmsg = strdup("This is the actual message");
@ -246,14 +246,14 @@ TEST_F(Engine514Test, check_engine514_encrypted) {
message* msg = new_message(PEP_dir_outgoing);
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, &carol);
PEP_STATUS status = set_up_preset(session, CAROL, true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
status = myself(session, carol);
ASSERT_EQ(status, PEP_STATUS_OK);
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
msg->from = carol;
msg->to = new_identity_list(dave);
msg->shortmsg = strdup("This is the actual message");


+ 2
- 2
test/src/Engine704Test.cc View File

@ -81,14 +81,14 @@ namespace {
TEST_F(Engine704Test, check_engine704) {
PEP_STATUS status = PEP_STATUS_OK;
pEp_identity* alice = NULL;
status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(alice);
status = myself(session, alice);
char* alicename = strdup(alice->username);
pEp_identity* alice_is_bob = NULL;
status = set_up_preset(session, BOB, false, true, true, false, true, &alice_is_bob);
status = set_up_preset(session, BOB, false, true, true, true, false, true, &alice_is_bob);
alice_is_bob->fpr = strdup("BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39");
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(alice_is_bob);


+ 1
- 1
test/src/GetKeyRatingForUserTest.cc View File

@ -87,7 +87,7 @@ namespace {
TEST_F(GetKeyRatingForUserTest, check_get_key_rating_for_user) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, false, false, false, false, false, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, false, true,false, false, false, false, &alice);
pEp_identity* test_null = NULL;
const char* fpr_save = alice->fpr;
alice->fpr = NULL;


+ 9
- 9
test/src/IsOwnKeyTest.cc View File

@ -90,7 +90,7 @@ PEP_STATUS set_up_preset(PEP_SESSION session,
*/
TEST_F(IsOwnKeyTest, check_is_own_key_normal) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
bool is_own = false;
status = is_own_key(session, alice->fpr, &is_own);
@ -103,7 +103,7 @@ TEST_F(IsOwnKeyTest, check_is_own_key_OpenPGP) {
TEST_F(IsOwnKeyTest, check_is_own_key_external_revoked) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
bool is_own = false;
status = is_own_key(session, alice->fpr, &is_own);
@ -119,7 +119,7 @@ TEST_F(IsOwnKeyTest, check_is_own_key_external_revoked) {
TEST_F(IsOwnKeyTest, check_is_own_key_external_marked_revoked) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
bool is_own = false;
status = is_own_key(session, alice->fpr, &is_own);
@ -142,7 +142,7 @@ TEST_F(IsOwnKeyTest, check_is_own_key_external_marked_revoked) {
TEST_F(IsOwnKeyTest, check_is_own_key_revoked_through_reset) { // Probably mistrusted case...
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
bool is_own = false;
status = is_own_key(session, alice->fpr, &is_own);
@ -158,7 +158,7 @@ TEST_F(IsOwnKeyTest, check_is_own_key_revoked_through_reset) { // Probably mistr
TEST_F(IsOwnKeyTest, check_is_own_key_mistrusted) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
bool is_own = false;
status = is_own_key(session, alice->fpr, &is_own);
@ -188,12 +188,12 @@ TEST_F(IsOwnKeyTest, check_is_own_key_expired) {
TEST_F(IsOwnKeyTest, check_is_key_someone_elses_pubkey) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
// Dave == NOT OWN
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
// import the private part also
const char* dave_fpr = "E8AC9779A2D13A15D8D55C84B049F489BB5BCCF6";
@ -205,12 +205,12 @@ TEST_F(IsOwnKeyTest, check_is_key_someone_elses_pubkey) {
TEST_F(IsOwnKeyTest, check_is_non_own_priv_key) {
pEp_identity* alice = NULL;
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, &alice);
PEP_STATUS status = set_up_preset(session, ALICE, true, true, true, true, true, true, &alice);
ASSERT_OK;
// Dave == NOT OWN
pEp_identity* dave = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &dave);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &dave);
// import the private part also
bool imported = slurp_and_import_key(session, "test_keys/priv/pep-test-dave-0xBB5BCCF6_priv.asc");
ASSERT_TRUE(imported);


+ 7
- 7
test/src/KeyResetMessageTest.cc View File

@ -2594,7 +2594,7 @@ test_keys/pub/pep.test.alexander6-0xBDA17020_pub.asc
TEST_F(KeyResetMessageTest, not_a_test) {
pEp_identity* bob = NULL;
PEP_STATUS status = set_up_preset(session, BOB,
true, true, true, true, true, &bob);
true, true, true, true, true, true, &bob);
const char* carol_fpr = "8DD4F5827B45839E9ACCA94687BDDFFB42A85A42";
slurp_and_import_key(session, "test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
@ -2626,7 +2626,7 @@ TEST_F(KeyResetMessageTest, not_a_test) {
TEST_F(KeyResetMessageTest, check_no_reset_message_to_self) {
pEp_identity* bob = NULL;
PEP_STATUS status = set_up_preset(session, BOB,
true, true, true, true, true, &bob);
true, true, true, true, true, true, &bob);
slurp_and_import_key(session, "test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
@ -2657,7 +2657,7 @@ TEST_F(KeyResetMessageTest, check_no_reset_message_to_self) {
TEST_F(KeyResetMessageTest, check_reset_mistrust_next_msg_have_not_mailed) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
status = myself(session, carol);
ASSERT_STREQ(carol->fpr, "8DD4F5827B45839E9ACCA94687BDDFFB42A85A42");
@ -3223,19 +3223,19 @@ TEST_F(KeyResetMessageTest, check_reset_own_with_revocations) {
pEp_identity* id1 = new_identity("krista-not-real@darthmama.org", NULL, PEP_OWN_USERID, "Krista at Home");
PEP_STATUS status = myself(session, id1);
pEp_identity* id2 = NULL;
status = set_up_preset(session, ALICE, true, true, false, false, false, &id2);
status = set_up_preset(session, ALICE, true, true, true, false, false, false, &id2);
pEp_identity* id3 = new_identity("krista-not-real@angryshark.eu", NULL, PEP_OWN_USERID, "Krista at Shark");
status = myself(session, id3);
pEp_identity* id4 = NULL;
status = set_up_preset(session, BOB, true, false, false, false, false, &id4);
status = set_up_preset(session, BOB, true, true,false, false, false, false, &id4);
pEp_identity* id5 = new_identity("krista-not-real@pep.foundation", NULL, PEP_OWN_USERID, "Krista at Work");
status = myself(session, id5);
pEp_identity* id6 = new_identity("grrrr-not-real@angryshark.eu", NULL, PEP_OWN_USERID, "GRRRR is a Shark");
status = myself(session, id6);
pEp_identity* id7 = NULL;
status = set_up_preset(session, CAROL, true, false, true, false, false, &id7);
status = set_up_preset(session, CAROL, true, true,false, true, false, false, &id7);
pEp_identity* id8 = NULL;
status = set_up_preset(session, DAVE, true, true, true, false, false, &id8);
status = set_up_preset(session, DAVE, true, true, true, true, false, false, &id8);
identity_list* own_identities = NULL;
stringlist_t* revocations = NULL;


+ 19
- 19
test/src/Message2_1Test.cc View File

@ -139,13 +139,13 @@ TEST_F(Message2_1Test, check_message2_1_recip_2_0) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_OK;
ASSERT_NOTNULL(alice);
status = set_up_preset(session, CAROL,
true, true, false, false, false, &carol);
true, true, true, false, false, false, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -196,13 +196,13 @@ TEST_F(Message2_1Test, check_message2_1_recip_OpenPGP) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_OK;
ASSERT_NOTNULL(alice);
status = set_up_preset(session, CAROL,
true, false, false, false, false, &carol);
true, true, false, false, false, false, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -244,13 +244,13 @@ TEST_F(Message2_1Test, check_message2_1_recip_2_1) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_OK;
ASSERT_NOTNULL(alice);
status = set_up_preset(session, CAROL,
true, true, false, false, false, &carol);
true, true, true, false, false, false, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -291,7 +291,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_1_0_from_msg_OpenPGP) {
pEp_identity* alex = NULL;
PEP_STATUS status = set_up_preset(session, ALEX_0,
true, true, true, true, true, &alex);
true, true, true, true, true, true, &alex);
ASSERT_OK;
ASSERT_NOTNULL(alex);
@ -338,7 +338,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_2_0_from_msg) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -385,7 +385,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_2_1_from_msg) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -441,13 +441,13 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_2_0) {
pEp_identity* alex = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_OK;
ASSERT_NOTNULL(alice);
status = set_up_preset(session, BOB,
true, true, false, false, false, &bob);
true, true, true, false, false, false, &bob);
ASSERT_OK;
ASSERT_NOTNULL(bob);
@ -461,7 +461,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_2_0) {
ASSERT_EQ(bob->minor_ver , 1);
status = set_up_preset(session, CAROL,
true, true, false, false, false, &carol);
true, true, true, false, false, false, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -475,7 +475,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_2_0) {
ASSERT_EQ(carol->minor_ver , 1);
status = set_up_preset(session, DAVE,
true, true, false, false, false, &dave);
true, true, true, false, false, false, &dave);
ASSERT_OK;
ASSERT_NOTNULL(dave);
@ -489,7 +489,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_2_0) {
ASSERT_EQ(dave->minor_ver , 0);
status = set_up_preset(session, ALEX,
true, true, true, false, false, &alex);
true, true, true, true, false, false, &alex);
ASSERT_OK;
ASSERT_NOTNULL(alex);
@ -536,13 +536,13 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_1_0_OpenPGP) {
pEp_identity* alex = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_OK;
ASSERT_NOTNULL(alice);
status = set_up_preset(session, BOB,
true, true, false, false, false, &bob);
true, true, true, false, false, false, &bob);
ASSERT_OK;
ASSERT_NOTNULL(bob);
@ -556,7 +556,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_1_0_OpenPGP) {
ASSERT_EQ(bob->minor_ver , 1);
status = set_up_preset(session, CAROL,
true, true, false, false, false, &carol);
true, true, true, false, false, false, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -570,7 +570,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_1_0_OpenPGP) {
ASSERT_EQ(carol->minor_ver , 1);
status = set_up_preset(session, DAVE,
true, true, false, false, false, &dave);
true, true, true, false, false, false, &dave);
ASSERT_OK;
ASSERT_NOTNULL(dave);
@ -584,7 +584,7 @@ TEST_F(Message2_1Test, check_message2_1_recip_mixed_1_0_OpenPGP) {
ASSERT_EQ(dave->minor_ver , 0);
status = set_up_preset(session, ALEX,
true, false, true, false, false, &alex);
true, true, false, true, false, false, &alex);
ASSERT_OK;
ASSERT_NOTNULL(alex);


+ 5
- 5
test/src/ReencryptPlusExtraKeysTest.cc View File

@ -151,7 +151,7 @@ TEST_F(ReencryptPlusExtraKeysTest, check_reencrypt_unencrypted_subj) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -205,7 +205,7 @@ TEST_F(ReencryptPlusExtraKeysTest, check_reencrypt_unencrypted_subj_check_effici
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_OK;
ASSERT_NOTNULL(carol);
@ -281,7 +281,7 @@ TEST_F(ReencryptPlusExtraKeysTest, check_reencrypt_unencrypted_subj_extra_keys)
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
@ -372,7 +372,7 @@ TEST_F(ReencryptPlusExtraKeysTest, check_reencrypt_unencrypted_subj_extra_keys_e
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);
@ -452,7 +452,7 @@ TEST_F(ReencryptPlusExtraKeysTest, check_reencrypt_unencrypted_subj_extra_keys_e
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, true, true, true, &carol);
true, true, true, true, true, true, &carol);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(carol);


+ 5
- 5
test/src/TestSetDefaultFPRTest.cc View File

@ -71,7 +71,6 @@ namespace {
engine = NULL;
session = NULL;
}
private:
const char* test_suite_name;
const char* test_name;
@ -84,7 +83,8 @@ namespace {
TEST_F(TestSetDefaultFPRTest, check_test_set_default_fpr) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
false, true, false, false, false, &carol);
true, false, true, false, false, false, &carol);
ASSERT_EQ(carol->fpr, nullptr);
status = update_identity(session, carol);
ASSERT_OK;
ASSERT_EQ(carol->fpr, nullptr);
@ -111,7 +111,7 @@ TEST_F(TestSetDefaultFPRTest, check_test_set_default_fpr) {
TEST_F(TestSetDefaultFPRTest, check_test_set_comm_partner_key) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
true, true, false, false, false, &carol);
true, false, true, false, false, false, &carol);
status = set_comm_partner_key(session, carol, carol_fpr);
ASSERT_OK;
status = update_identity(session, carol);
@ -135,7 +135,7 @@ TEST_F(TestSetDefaultFPRTest, check_test_set_comm_partner_key) {
TEST_F(TestSetDefaultFPRTest, check_test_set_default_no_identity) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
false, true, false, false, false, &carol);
true, false, true, false, false, false, &carol);
status = update_identity(session, carol);
ASSERT_OK;
ASSERT_EQ(carol->fpr, nullptr);
@ -163,7 +163,7 @@ TEST_F(TestSetDefaultFPRTest, check_test_set_default_no_identity) {
TEST_F(TestSetDefaultFPRTest, check_test_set_comm_partner_key_no_set_identity) {
pEp_identity* carol = NULL;
PEP_STATUS status = set_up_preset(session, CAROL,
false, false, false, false, false, &carol);
false, false, false, false, false, false, &carol);
string user_id_cache = carol->user_id;
status = set_comm_partner_key(session, carol, carol_fpr);
ASSERT_OK;


+ 3
- 3
test/src/UnencryptedPepMailTest.cc View File

@ -86,7 +86,7 @@ TEST_F(UnencryptedPepMailTest, check_unencrypted_pep_mail_outgoing) {
pEp_identity* dave = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(alice);
@ -135,7 +135,7 @@ TEST_F(UnencryptedPepMailTest, check_unencrypted_pep_mail_outgoing_MIME) {
pEp_identity* dave = NULL;
PEP_STATUS status = set_up_preset(session, ALICE,
true, true, true, true, true, &alice);
true, true, true, true, true, true, &alice);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(alice);
@ -186,7 +186,7 @@ PEP_STATUS set_up_preset(PEP_SESSION session,
TEST_F(UnencryptedPepMailTest, check_unencrypted_pep_message_rcpt) {
string msgstr = slurp("test_mails/unenc_pep_msg_test_1.eml");
PEP_STATUS status = set_up_preset(session, DAVE,
true, true, true, true, true, NULL);
true, true, true, true, true, true, NULL);
ASSERT_EQ(status, PEP_STATUS_OK);
message* dec_msg = NULL;
message* enc_msg = NULL;


+ 2
- 1
test/src/test_util.cc View File

@ -824,6 +824,7 @@ PEP_STATUS set_fpr_preserve_ident(PEP_SESSION session, const pEp_identity* ident
PEP_STATUS set_up_preset(PEP_SESSION session,
pEp_test_ident_preset preset_name,
bool set_ident,
bool set_fpr,
bool set_pep,
bool trust,
bool set_own,
@ -1043,7 +1044,7 @@ PEP_STATUS set_up_preset(PEP_SESSION session,
// honestly probably happens anyway
if (set_ident && status == PEP_STATUS_OK) {
retval->fpr = strdup(fpr);
retval->fpr = set_fpr ? strdup(fpr) : NULL;
status = set_identity(session, retval);
}


+ 2
- 1
test/src/test_util.h View File

@ -78,7 +78,8 @@ typedef enum _pEp_test_ident_preset {
PEP_STATUS set_up_preset(PEP_SESSION session,
pEp_test_ident_preset preset_name,
bool set_identity,
bool set_identity,
bool set_fpr,
bool set_pep,
bool trust,
bool set_own,


Loading…
Cancel
Save