From c6ea3d784ee920f51de3088437b471c8dd6d70e2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 18 Nov 2021 15:54:46 +0300 Subject: Add openssl::info() overloads --- tests/openssl/driver.cxx | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'tests') 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 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 r (os.in.read_binary ()); + os.in.close (); + + assert (os.wait () && r.size () == 128); + } + + // Test openssl info retrieval. + // + { + optional v (openssl::info (2, path ("openssl"))); + + assert (v); + } + + return 0; } catch (const system_error& e) { -- cgit v1.1