mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-10-29 05:40:16 -04:00 
			
		
		
		
	tests: Add free-without-remove test
[Derek Foreman <derekf@osg.samsung.com> moved this into resources-test] Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
		
							parent
							
								
									5e0f7ad1bf
								
							
						
					
					
						commit
						0e6ac72288
					
				
					 1 changed files with 24 additions and 0 deletions
				
			
		|  | @ -182,3 +182,27 @@ TEST(create_resource_with_same_id) | ||||||
| 	wl_display_destroy(display); | 	wl_display_destroy(display); | ||||||
| 	close(s[1]); | 	close(s[1]); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | static void | ||||||
|  | display_destroy_notify(struct wl_listener *l, void *data) | ||||||
|  | { | ||||||
|  | 	l->link.prev = l->link.next = NULL; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | TEST(free_without_remove) | ||||||
|  | { | ||||||
|  | 	struct wl_display *display; | ||||||
|  | 	struct wl_listener a, b; | ||||||
|  | 
 | ||||||
|  | 	display = wl_display_create(); | ||||||
|  | 	a.notify = display_destroy_notify; | ||||||
|  | 	b.notify = display_destroy_notify; | ||||||
|  | 
 | ||||||
|  | 	wl_display_add_destroy_listener(display, &a); | ||||||
|  | 	wl_display_add_destroy_listener(display, &b); | ||||||
|  | 
 | ||||||
|  | 	wl_display_destroy(display); | ||||||
|  | 
 | ||||||
|  | 	assert(a.link.next == a.link.prev && a.link.next == NULL); | ||||||
|  | 	assert(b.link.next == b.link.prev && b.link.next == NULL); | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Markus Ongyerth
						Markus Ongyerth