Skip to content

Commit 07d804c

Browse files
committed
Add license and change to 2-space indents for openal ext test
1 parent 366943a commit 07d804c

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

test/openal_extensions.c

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright 2024 The Emscripten Authors. All rights reserved.
3+
* Emscripten is available under two separate licenses, the MIT license and the
4+
* University of Illinois/NCSA Open Source License. Both these licenses can be
5+
* found in the LICENSE file.
6+
*/
7+
18
// So far just does some sanity checks for the available extensions.
29
//
310
// In the future, could also try to enable different extensions and test for
@@ -16,56 +23,56 @@ static int result = EXIT_SUCCESS;
1623

1724
static void end_test() {
1825
#ifdef __EMSCRIPTEN__
19-
REPORT_RESULT(result);
26+
REPORT_RESULT(result);
2027
#endif
21-
exit(result);
28+
exit(result);
2229
}
2330

2431
#define NUM_ALC_EXTENSIONS 2
2532
static const ALCchar *alc_extensions[NUM_ALC_EXTENSIONS] = {
26-
"ALC_SOFT_pause_device",
27-
"ALC_SOFT_HRTF",
33+
"ALC_SOFT_pause_device",
34+
"ALC_SOFT_HRTF",
2835
};
2936

3037
#define NUM_AL_EXTENSIONS 5
3138
static const ALCchar *al_extensions[NUM_AL_EXTENSIONS] = {
32-
"AL_EXT_float32",
33-
"AL_SOFT_loop_points",
34-
"AL_SOFT_source_length",
35-
"AL_EXT_source_distance_model",
36-
"AL_SOFT_source_spatialize",
39+
"AL_EXT_float32",
40+
"AL_SOFT_loop_points",
41+
"AL_SOFT_source_length",
42+
"AL_EXT_source_distance_model",
43+
"AL_SOFT_source_spatialize",
3744
};
3845

3946
static void check_alc_extension(const ALCchar *extension) {
40-
ALCdevice *device = alcOpenDevice(NULL);
41-
if (!device) {
42-
fprintf(stderr, "Failed to open default device.");
43-
result = EXIT_FAILURE;
44-
return;
45-
}
47+
ALCdevice *device = alcOpenDevice(NULL);
48+
if (!device) {
49+
fprintf(stderr, "Failed to open default device.");
50+
result = EXIT_FAILURE;
51+
return;
52+
}
4653

47-
if (alcIsExtensionPresent(device, extension) != ALC_TRUE) {
48-
fprintf(stderr, "Extension %s was not present.", extension);
49-
result = EXIT_FAILURE;
50-
}
54+
if (alcIsExtensionPresent(device, extension) != ALC_TRUE) {
55+
fprintf(stderr, "Extension %s was not present.", extension);
56+
result = EXIT_FAILURE;
57+
}
5158
}
5259

5360
static void check_al_extension(const ALchar *extension) {
54-
if (alIsExtensionPresent(extension) != ALC_TRUE) {
55-
fprintf(stderr, "Extension %s was not present.", extension);
56-
result = EXIT_FAILURE;
57-
}
61+
if (alIsExtensionPresent(extension) != ALC_TRUE) {
62+
fprintf(stderr, "Extension %s was not present.", extension);
63+
result = EXIT_FAILURE;
64+
}
5865
}
5966

6067
int main() {
6168

62-
for(int i = 0; i < NUM_ALC_EXTENSIONS; i++) {
63-
check_alc_extension(alc_extensions[i]);
64-
}
69+
for (int i = 0; i < NUM_ALC_EXTENSIONS; i++) {
70+
check_alc_extension(alc_extensions[i]);
71+
}
6572

66-
for(int i = 0; i < NUM_AL_EXTENSIONS; i++) {
67-
check_al_extension(al_extensions[i]);
68-
}
73+
for (int i = 0; i < NUM_AL_EXTENSIONS; i++) {
74+
check_al_extension(al_extensions[i]);
75+
}
6976

70-
end_test();
77+
end_test();
7178
}

0 commit comments

Comments
 (0)