File Annotation
Not logged in
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # Copyright (c) 2006 D. Richard Hipp
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # This program is free software; you can redistribute it and/or
dbda8d6ce9 2007-07-21       drh: # modify it under the terms of the GNU General Public
dbda8d6ce9 2007-07-21       drh: # License version 2 as published by the Free Software Foundation.
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # This program is distributed in the hope that it will be useful,
dbda8d6ce9 2007-07-21       drh: # but WITHOUT ANY WARRANTY; without even the implied warranty of
dbda8d6ce9 2007-07-21       drh: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dbda8d6ce9 2007-07-21       drh: # General Public License for more details.
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # You should have received a copy of the GNU General Public
dbda8d6ce9 2007-07-21       drh: # License along with this library; if not, write to the
dbda8d6ce9 2007-07-21       drh: # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dbda8d6ce9 2007-07-21       drh: # Boston, MA  02111-1307, USA.
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # Author contact information:
dbda8d6ce9 2007-07-21       drh: #   drh@hwaci.com
dbda8d6ce9 2007-07-21       drh: #   http://www.hwaci.com/drh/
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: ############################################################################
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: # Tests of the delta mechanism.
dbda8d6ce9 2007-07-21       drh: #
dbda8d6ce9 2007-07-21       drh: 
dbda8d6ce9 2007-07-21       drh: set filelist [glob $testdir/*]
dbda8d6ce9 2007-07-21       drh: foreach f $filelist {
dbda8d6ce9 2007-07-21       drh:   set base [file root [file tail $f]]
dbda8d6ce9 2007-07-21       drh:   set f1 [read_file $f]
dbda8d6ce9 2007-07-21       drh:   write_file t1 $f1
dbda8d6ce9 2007-07-21       drh:   for {set i 0} {$i<100} {incr i} {
dbda8d6ce9 2007-07-21       drh:     expr {srand($i*2)}
dbda8d6ce9 2007-07-21       drh:     write_file t2 [set f2 [random_changes $f1 2 4 0 0.1]]
dbda8d6ce9 2007-07-21       drh:     expr {srand($i*2+1)}
dbda8d6ce9 2007-07-21       drh:     write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]]
dbda8d6ce9 2007-07-21       drh:     expr {srand($i*2+1)}
dbda8d6ce9 2007-07-21       drh:     write_file t23 [random_changes $f2 2 4 2 0.1]
dbda8d6ce9 2007-07-21       drh:     expr {srand($i*2)}
dbda8d6ce9 2007-07-21       drh:     write_file t32 [random_changes $f3 2 4 0 0.1]
dbda8d6ce9 2007-07-21       drh:     fossil test-3-way-merge t1 t2 t3 a23
dbda8d6ce9 2007-07-21       drh:     test merge-$base-$i-23 {[same_file a23 t23]}
dbda8d6ce9 2007-07-21       drh:     fossil test-3-way-merge t1 t3 t2 a32
dbda8d6ce9 2007-07-21       drh:     test merge-$base-$i-32 {[same_file a32 t32]}
dbda8d6ce9 2007-07-21       drh:   }
dbda8d6ce9 2007-07-21       drh: }