mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	tests/leaks.sh: workaround minor variation when run with shcomp
For unknown reasons, the test for a memory leak in 'read -C stat <<< "$data"' can show an intermittent minor variation in memory usage when run with shcomp on certain versions of macOS. The reported variations are 48 bytes or 80 bytes. This is too small to be the result of an actual memory leak in the tested command; it is repeated 500 times so that any real leak should show a difference of at least 500 bytes. src/cmd/ksh93/tests/leaks.sh: - Add a tolerance of 128 bytes to get rid of the false failure. Fixes #70 (hopefully).
This commit is contained in:
		
							parent
							
								
									778fd6ca2d
								
							
						
					
					
						commit
						84e2f6d92f
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -99,7 +99,8 @@ for ((i=0; i < 500; i++))
 | 
				
			||||||
do      read -C stat <<< "$data"
 | 
					do      read -C stat <<< "$data"
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
after=$(getmem)
 | 
					after=$(getmem)
 | 
				
			||||||
(( after > before )) && err_exit "memory leak with read -C when using <<< (leaked $((after - before)) $unit)"
 | 
					# this test can show minor variations in memory usage when run with shcomp: https://github.com/ksh93/ksh/issues/70
 | 
				
			||||||
 | 
					(( after > before+128 )) && err_exit "memory leak with read -C when using <<< (leaked $((after - before)) $unit)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ======
 | 
					# ======
 | 
				
			||||||
# Unsetting an associative array shouldn't cause a memory leak
 | 
					# Unsetting an associative array shouldn't cause a memory leak
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue