mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	connection-test: Add test case to stress connection buffers
This catches the bug fixed in cab70c9e5d.
			
			
This commit is contained in:
		
							parent
							
								
									b01ae07727
								
							
						
					
					
						commit
						9086b60d81
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		| 
						 | 
					@ -402,3 +402,25 @@ TEST(connection_marshal_demarshal)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	release_marshal_data(&data);
 | 
						release_marshal_data(&data);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST(connection_marshal_alot)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct marshal_data data;
 | 
				
			||||||
 | 
						char f[64];
 | 
				
			||||||
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						setup_marshal_data(&data);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						/* We iterate enough to make sure we wrap the circular buffers
 | 
				
			||||||
 | 
						 * for both regular data an fds. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (i = 0; i < 2000; i++) {
 | 
				
			||||||
 | 
							strcpy(f, "/tmp/weston-tests-XXXXXX");
 | 
				
			||||||
 | 
							data.value.h = mkstemp(f);
 | 
				
			||||||
 | 
							assert(data.value.h >= 0);
 | 
				
			||||||
 | 
							marshal_demarshal(&data, (void *) validate_demarshal_h,
 | 
				
			||||||
 | 
									  8, "h", data.value.h);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						release_marshal_data(&data);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue