diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-11-18 15:54:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-11-18 15:54:46 +0300 |
commit | ee59f90d0a7044ba9d0a146aefceb34e78891ab5 (patch) | |
tree | 8c19aae17abd931fa9751339f03e8306e5609592 /tests | |
parent | fe4ce42d093eeb009081958d4339818ef46274ea (diff) |
Add openssl::info() overloads
Diffstat (limited to 'tests')
-rw-r--r-- | tests/openssl/driver.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/openssl/driver.cxx b/tests/openssl/driver.cxx index d671c00..55f91dd 100644 --- a/tests/openssl/driver.cxx +++ b/tests/openssl/driver.cxx @@ -23,12 +23,28 @@ int main (int, const char* argv[]) try { - openssl os (nullfd, path ("-"), 2, path ("openssl"), "rand", 128); + using butl::optional; - vector<char> r (os.in.read_binary ()); - os.in.close (); + // Test openssl rand command. + // + { + openssl os (nullfd, path ("-"), 2, path ("openssl"), "rand", 128); - return os.wait () && r.size () == 128 ? 0 : 1; + vector<char> r (os.in.read_binary ()); + os.in.close (); + + assert (os.wait () && r.size () == 128); + } + + // Test openssl info retrieval. + // + { + optional<openssl_info> v (openssl::info (2, path ("openssl"))); + + assert (v); + } + + return 0; } catch (const system_error& e) { |