intl/uconv/tests/stressgb.pl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 #!/usr/bin/perl
     2 use LWP::Simple;
     3 use IO::Handle;
     4 $stdout = *STDOUT;
     5 open(RES , ">resultlog.txt") || die "cannot open result log file";
     6 #system("rm alldiff.txt in*.txt out*.txt");
     7 for($i=10;$i<909;$i++)
     8 {
     9    RES->printf("Test Page %d \n", $i);
    10    $url = "http://people.netscape.com/ftang/testscript/gb18030/gbtext.cgi?page=" . $i;
    11    RES->printf( "URL = %s\n", $url);
    12    $tmpfile = "> in". $i . ".txt";
    13    open STDOUT, $tmpfile || RES->print("cannot open " . $tmpfile . "\n");
    14    getprint $url;
    15    $cmd2 = "../../../dist/win32_d.obj/bin/nsconv -f GB18030 -t GB18030 in" . $i . ".txt out" . $i . ".txt >err";
    16    $cmd3 = "diff -u in" . $i . ".txt out" . $i . ".txt >> alldiff.txt";
    17    RES->printf( "Run  '%s'\n", $cmd2);
    18    $st2 = system($cmd2);
    19    RES->printf( "result = '%d'\n", $st2);
    20    RES->printf( "Run  '%s'\n", $cmd3);
    21    $st3 = system($cmd3);
    22    RES->printf( "result = '%d'\n", $st3);
    23 }

mercurial