1# 2# Copyright (c) 2006 D. Richard Hipp 3# 4# This program is free software; you can redistribute it and/or 5# modify it under the terms of the Simplified BSD License (also 6# known as the "2-Clause License" or "FreeBSD License".) 7# 8# This program is distributed in the hope that it will be useful, 9# but without any warranty; without even the implied warranty of 10# merchantability or fitness for a particular purpose. 11# 12# Author contact information: 13# drh@hwaci.com 14# http://www.hwaci.com/drh/ 15# 16############################################################################ 17# 18# Tests of the delta mechanism. 19# 20 21test_setup "" 22 23set filelist [glob $testdir/*] 24foreach f $filelist { 25 if {[file isdir $f]} continue 26 set base [file root [file tail $f]] 27 if {[string match "utf16*" $base]} continue 28 set f1 [read_file $f] 29 write_file t1 $f1 30 for {set i 0} {$i<100} {incr i} { 31 expr {srand($i*2)} 32 write_file t2 [set f2 [random_changes $f1 2 4 0 0.1]] 33 expr {srand($i*2+1)} 34 write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]] 35 expr {srand($i*2+1)} 36 write_file t23 [random_changes $f2 2 4 2 0.1] 37 expr {srand($i*2)} 38 write_file t32 [random_changes $f3 2 4 0 0.1] 39 fossil 3-way-merge t1 t2 t3 a23 40 if {[regexp {<<<<< BEGIN MERGE CONFLICT:} [read_file a23]]} continue 41 test merge-$base-$i-23 {[same_file a23 t23]} 42 fossil 3-way-merge t1 t3 t2 a32 43 test merge-$base-$i-32 {[same_file a32 t32]} 44 } 45} 46 47############################################################################### 48 49test_cleanup 50