File tree Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Original file line number Diff line number Diff line change 12
12
13
13
#include <stdio.h>
14
14
#include <stdlib.h>
15
- #ifdef __EMSCRIPTEN__
16
- #include <emscripten.h>
17
- #endif
15
+ #include <assert.h>
18
16
#include <AL/al.h>
19
17
#include <AL/alc.h>
20
18
#include <AL/alext.h>
21
19
22
- static int result = EXIT_SUCCESS ;
23
-
24
- static void end_test () {
25
- #ifdef __EMSCRIPTEN__
26
- REPORT_RESULT (result );
27
- #endif
28
- exit (result );
29
- }
30
-
31
20
#define NUM_ALC_EXTENSIONS 2
32
21
static const ALCchar * alc_extensions [NUM_ALC_EXTENSIONS ] = {
33
22
"ALC_SOFT_pause_device" ,
@@ -45,23 +34,13 @@ static const ALCchar *al_extensions[NUM_AL_EXTENSIONS] = {
45
34
46
35
static void check_alc_extension (const ALCchar * extension ) {
47
36
ALCdevice * device = alcOpenDevice (NULL );
48
- if (!device ) {
49
- fprintf (stderr , "Failed to open default device." );
50
- result = EXIT_FAILURE ;
51
- return ;
52
- }
53
37
54
- if (alcIsExtensionPresent (device , extension ) != ALC_TRUE ) {
55
- fprintf (stderr , "Extension %s was not present." , extension );
56
- result = EXIT_FAILURE ;
57
- }
38
+ assert (device );
39
+ assert (alcIsExtensionPresent (device , extension ) == ALC_TRUE );
58
40
}
59
41
60
42
static void check_al_extension (const ALchar * extension ) {
61
- if (alIsExtensionPresent (extension ) != ALC_TRUE ) {
62
- fprintf (stderr , "Extension %s was not present." , extension );
63
- result = EXIT_FAILURE ;
64
- }
43
+ assert (alIsExtensionPresent (extension ) == ALC_TRUE );
65
44
}
66
45
67
46
int main () {
@@ -74,5 +53,5 @@ int main() {
74
53
check_al_extension (al_extensions [i ]);
75
54
}
76
55
77
- end_test () ;
56
+ return 0 ;
78
57
}
Original file line number Diff line number Diff line change @@ -2298,7 +2298,7 @@ def test_openal_capture_sanity(self):
2298
2298
self .btest ('openal_capture_sanity.c' , expected = '0' )
2299
2299
2300
2300
def test_openal_extensions (self ):
2301
- self .btest ('openal_extensions.c' , expected = '0 ' )
2301
+ self .btest_exit ('openal_extensions.c' )
2302
2302
2303
2303
def test_runtimelink (self ):
2304
2304
create_file ('header.h' , r'''
You can’t perform that action at this time.
0 commit comments