Hi Sajnank,

On 2011-09-14 10:24, sajnank wrote:
> I am using openssl-1.0.0 on Suse Linux. I want to know what is the
> purpose of each application in the 'test' folder of the library? What
> test they are doing?

They are automated tests. They test whether the code works as expected.
There are great introductions to automated testing around the Internet
and you may find some under "unit testing" (though more of a
sub-category of automated testing).

Consider a sorting function:

int sort(int size, char** array) { /* ... */ }

It's pretty easy to code that. But of course, humans err, and so you
would test your code. One way of testing the code is creating and
printing an array and then printing the apparently-sorted version.
Another way might be to log verbosely and watch the output of a proper
run of your program.

The "automated testing" approach would be to construct some input array
and the expected output array. Then, compare whether

    array /* after running sort(length, array) */

and

    expected_array

are equal. If they are not, that's called a "failed" test.

All make sense?

As I said, if you want a more in-depth introduction, get one of the
brilliant tutorials you can find online. I can also recommend the
Pragmatic Programmers book on unit testing.

- Jerome

-- 
PGP: A0E4 B2D4 94E6 20EE 85BA E45B 63E4 2BD8 C58C 753A
PGP: 2C23 EBFF DF1A 840D 2351 F5F5 F25B A03F 2152 36DA
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to