test/src/engine_tests/GPGConfFixTests.cc
branchENGINE-450-MARK-II
changeset 2795 4bd160717c54
parent 2783 83dafb06379c
child 2798 e0abb44b8098
child 2821 7fe5b66e570d
     1.1 --- a/test/src/engine_tests/GPGConfFixTests.cc	Tue Jul 31 11:11:25 2018 +0200
     1.2 +++ b/test/src/engine_tests/GPGConfFixTests.cc	Tue Jul 31 21:39:01 2018 +0200
     1.3 @@ -29,6 +29,21 @@
     1.4                                                                        static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_conf_old_db_5)));
     1.5      add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_conf_old_db_6"),
     1.6                                                                        static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_conf_old_db_6)));                                                                      
     1.7 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_0"),
     1.8 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_0)));
     1.9 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_1"),
    1.10 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_1)));
    1.11 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_2"),
    1.12 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_2)));
    1.13 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_3"),
    1.14 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_3)));
    1.15 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_4"),
    1.16 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_4)));
    1.17 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_5"),
    1.18 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_5)));
    1.19 +    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_6"),
    1.20 +                                                                      static_cast<Func>(&GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_6)));                                                                      
    1.21 +                                                                      
    1.22  }
    1.23  
    1.24  void GPGConfFixTests::setup() {
    1.25 @@ -115,3 +130,38 @@
    1.26      TEST_ASSERT(file_bytes_equal("test_files/427_fixed_gpg_conf_6", (temp_test_home + "/.gnupg/gpg.conf").c_str()));    
    1.27  }
    1.28  
    1.29 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_0() {
    1.30 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_0", "test_files/427_old_db");
    1.31 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_0", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));
    1.32 +}
    1.33 +
    1.34 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_1() {
    1.35 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_1", "test_files/427_old_db");    
    1.36 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_1", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));
    1.37 +    
    1.38 +}
    1.39 +
    1.40 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_2() {
    1.41 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_2", "test_files/427_old_db");        
    1.42 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_2", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));    
    1.43 +}
    1.44 +
    1.45 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_3() {
    1.46 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_3", "test_files/427_old_db");    
    1.47 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_3", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));    
    1.48 +}
    1.49 +
    1.50 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_4() {
    1.51 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_4", "test_files/427_old_db");        
    1.52 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_4", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));    
    1.53 +}
    1.54 +
    1.55 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_5() {
    1.56 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_5", "test_files/427_old_db");        
    1.57 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_5", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));    
    1.58 +}
    1.59 +
    1.60 +void GPGConfFixTests::check_conf_fix_broken_agent_conf_old_db_6() {
    1.61 +    set_full_env(NULL, "test_files/450_bad_gpgagent_conf_6", "test_files/427_old_db");        
    1.62 +    TEST_ASSERT(file_bytes_equal("test_files/450_good_gpgagent_conf_6", (temp_test_home + "/.gnupg/gpg-agent.conf").c_str()));    
    1.63 +}