File: unit_test_example5.html

package info (click to toggle)
boost 1.33.1-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 100,948 kB
  • ctags: 145,103
  • sloc: cpp: 573,492; xml: 49,055; python: 15,626; ansic: 13,588; sh: 2,099; yacc: 858; makefile: 660; perl: 427; lex: 111; csh: 6
file content (68 lines) | stat: -rw-r--r-- 3,237 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<HTML>
<HEAD>
<TITLE>Boost Test Library: unit_test_example5 example</TITLE>
<LINK rel="stylesheet" type="text/css" href="../style/btl.css" media="screen">
<LINK rel="stylesheet" type="text/css" href="../style/btl-print.css" media="print">
<META http-equiv="Content-Language" content="en-us">
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<DIV class="header"> <A href="../index.html">Boost.Test</A> > <A href="index.html">Examples</A> > <SPAN class="current_article">unit_test_example5</SPAN> 
</DIV>
<DIV class="body"> <IMG src='../btl1.gif' width='252' height='43' alt="Boost Test logo"> 
  <H1 class="subtitle">The Unit Test Framework example 5</H1>
  <TABLE class="test-example-summary">
    <TR>
      <TD class="title" valign="top">Rationale:</TD>
      <TD>this moderately complex example presents test program for the family of trivial hash functions. 
        On the way among other things it demonstrates:<BR>
        <UL>
          <LI>an ability to construct parameterized test cases based on user class's member function</LI>
          <LI>usage of shared instance of user test case</LI>
          <LI>ability to store test case parameters in user test case</LI>
        </UL>
      </TD>
    </TR>
    <TR>
      <TD class="title" valign="top">Input:</TD>
      <TD>This example not require input in a following format:<BR>
        alphabet<BR>
        string hash-value<BR>
        string hash-value<BR>
        ...<BR>
        <BR>
        hash-value is positive integer. hash-value -1 designate expected "wrong length" error. <BR>
        hash-value -2 designate expected "non-alphabet letter in string" error. Here is an example input:<BR>
        <A href="../../example/unit_test_example5.input">unit_test_example5.input</A> </TD>
    </TR>
    <TR>
      <TD class="title" valign="top">Output:</TD>
      <TD>If you use supplied input like this: unit_test_example5 &lt; unit_test_example5.input, you will 
        get:<BR>
        <SPAN class="test-output">Enter alphabet (4 characters without delimiters)<BR>
        <BR>
        Enter test data in a format [string] [value] to check correct calculation<BR>
        Enter test data in a format [string] -1 to check long string validation<BR>
        Enter test data in a format [string] -2 to check invalid argument string validation<BR>
        <BR>
        Running 1 test case...<BR>
        <BR>
        *** No errors detected </SPAN> </TD>
    </TR>
    <TR>
      <TD class="title" valign="top">Source:</TD>
      <TD><A href="../../example/unit_test_example5.cpp">unit_test_example5.cpp</A></TD>
    </TR>
  </TABLE>
</DIV>
<DIV class="footer"> 
  <DIV class="footer-body"> 
    <P> &copy <A name="Copyright">Copyright</A> <A href='mailto:boost-test at emailaccount dot com (please unobscure)'>Gennadiy Rozental</A> 2001-2005. <BR>
      Distributed under the Boost Software License, Version 1.0.
      (See accompanying file <A href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or copy at 
      <A href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</A>)</P>
        <P>Revised:        <!-- #BeginDate format:Sw1 -->6 January, 2004<!-- #EndDate -->     </P>
  </DIV>
</DIV>
</BODY>
</HTML>