The unified diff between revisions [63c067b5..] and [67768644..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'checks/pk.cpp'

#
#
# patch "checks/pk.cpp"
#  from [93e0079f5e99691acd65ce9689d47da57c81b0ea]
#    to [a35abb667d6a1455f720ca7d084150f1fe76a907]
#
============================================================
--- checks/pk.cpp	93e0079f5e99691acd65ce9689d47da57c81b0ea
+++ checks/pk.cpp	a35abb667d6a1455f720ca7d084150f1fe76a907
@@ -52,11 +52,8 @@ class Fixed_Output_RNG : public RandomNu
          {
          if(position < output.size())
             return output[position++];
-         std::cout << "Fixed_Output_RNG: Ran out of bits" << std::endl;
-         std::exit(1);
-         // Annoying: some compilers warn if a return is here (unreachable
-         // code), others warn if it's not (no return from function).
-         /* return 0; */
+
+         throw Botan::Invalid_State("Fixed_Output_RNG: out of bits");
          }
       void randomize(byte out[], u32bit len) throw()
          {
@@ -101,10 +98,7 @@ u32bit do_pk_validation_tests(const std:
    std::ifstream test_data(filename.c_str());

    if(!test_data)
-       {
-       std::cout << "Couldn't open test file " << filename << std::endl;
-       std::exit(1);
-       }
+      throw Botan::Stream_IO_Error("Couldn't open test file " + filename);

    u32bit errors = 0, alg_count = 0;
    std::string algorithm, print_algorithm;
@@ -112,10 +106,8 @@ u32bit do_pk_validation_tests(const std:
    while(!test_data.eof())
       {
       if(test_data.bad() || test_data.fail())
-         {
-         std::cout << "File I/O error." << std::endl;
-         std::exit(1);
-         }
+         throw Botan::Stream_IO_Error("File I/O error reading from " +
+                                      filename);

       std::string line;
       std::getline(test_data, line);