<co*******@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Raghu Uppalli wrote: what exactly do you intend to test? Do you want to test if they
behave as advertised?
Yes their functionality. How do you test strlen ? Can the string be
varied from 0 through n ? OR Is their any other way of doing it ?
Please feel free to share your thoughts.
I don't know why you'd want to do such a test, but you know what it's
supposed to do, right? So feed it some data and see if it gets the right
answers. Test the empty string (just a null terminator in the first
position). Test a bunch of strings whose length you know. Or make a large
array, and loop through making it adding one character and testing the
strlen function on it each time. There is no standard for such a test. And
testing will only tell you that the test did not fail... it will not prove
the correctness of the code. Seems like a waste of time to me, since the
C++ compiler vendor had already done all that testing for you, at least if
they're worth their salt! I pretty much rely on the correctness of my C++
library and STL, otherwise I'd never be able to trust my own code, since it
relies on what I've been provided as a tool base.
-Howard