Imported Robodoc.
[robodoc.git] / Source / Test / header_size_test.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use ROBOTest;
5
6 #****x* SystemTest/header_size_test_pl
7 # FUNCTION
8 #   Test whether robodoc can handle large headers.  Robodoc uses a
9 #   dynamically expanding buffer for storing headers.  This dynamic
10 #   expansion might go wrong.  The input file for this test is
11 #   generated by the makefile entry header_size_test
12 # SOURCE
13 #
14
15 ROBOTest::start("Header Size Test");
16
17 #   They are 129 lines of the form
18 #      xxxxxxxxx_<number>
19 #   in the header.
20 #   Lets test if they all turn up in the documentation.
21 #
22 my $checksum = 0;
23 foreach my $n (1 .. 129) {
24     $checksum += $n;
25 }
26 my $sum = 0;
27 while (my $line = <>) {
28     if ($line =~ m/xxxx_(\d+)/) {
29         $sum += $1;
30     }
31 }
32
33 ROBOTest::assert( $sum == $checksum );
34 ROBOTest::finish;
35
36 0;
37
38 #*****
39