aboutsummaryrefslogtreecommitdiff
path: root/tests/openssl/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-11-18 15:54:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-11-19 12:14:48 +0300
commitc6ea3d784ee920f51de3088437b471c8dd6d70e2 (patch)
tree4719f7225d9392143de7650f55c97ba81ad54043 /tests/openssl/driver.cxx
parentfe4ce42d093eeb009081958d4339818ef46274ea (diff)
Add openssl::info() overloads
Diffstat (limited to 'tests/openssl/driver.cxx')
-rw-r--r--tests/openssl/driver.cxx24
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)
{