mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Make the rtstutter tests mostly pointless without CLOCK_REALTIME.
On the other hand, this actually makes the test build, and test at least that it doesn't abort away, when the CLOCK_REALTIME interface is not present (or when clock_gettime is not found).
This commit is contained in:
		
							parent
							
								
									8c85c99996
								
							
						
					
					
						commit
						542607f4c6
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -67,7 +67,9 @@ static void* work(void *p) {
 | 
			
		|||
        pa_log_notice("CPU%i: Sleeping for 1s", PA_PTR_TO_UINT(p));
 | 
			
		||||
        sleep(1);
 | 
			
		||||
 | 
			
		||||
#ifdef CLOCK_REALTIME
 | 
			
		||||
        pa_assert_se(clock_gettime(CLOCK_REALTIME, &end) == 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        nsec =
 | 
			
		||||
            (uint64_t) ((((double) rand())*(double)(msec_upper-msec_lower)*PA_NSEC_PER_MSEC)/RAND_MAX) +
 | 
			
		||||
| 
						 | 
				
			
			@ -84,7 +86,9 @@ static void* work(void *p) {
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        do {
 | 
			
		||||
#ifdef CLOCK_REALTIME
 | 
			
		||||
            pa_assert_se(clock_gettime(CLOCK_REALTIME, &now) == 0);
 | 
			
		||||
#endif
 | 
			
		||||
        } while (now.tv_sec < end.tv_sec ||
 | 
			
		||||
                 (now.tv_sec == end.tv_sec && now.tv_nsec < end.tv_nsec));
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue