Added unit test to explore the deallocation failure.
This commit is contained in:
		
							parent
							
								
									ea0d9a2629
								
							
						
					
					
						commit
						fae4a4d444
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								unit-tests/memory.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								unit-tests/memory.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					actual=`echo "" | target/psse  2>&1 | tail -2`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					alloc=`echo $actual | sed 's/[[:punct:]]/ /g' | awk '{print $4}'`
 | 
				
			||||||
 | 
					dealloc=`echo $actual | sed 's/[[:punct:]]/ /g' | awk '{print $6}'`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "${alloc}" = "${dealloc}" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					    echo "OK"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    echo "Fail: expected '${alloc}', got '${dealloc}'"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue