Skip to content

Commit 196a9dd

Browse files
committed
short version of test_openal_buf for automated tests
1 parent e52b3e4 commit 196a9dd

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

test/openal/test_openal_buffers.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ void iter() {
8989
alGetSourcef(source, AL_PITCH, &testPitch);
9090
assert(pitch == testPitch);
9191
#endif
92-
92+
#ifdef TEST_FAST
93+
offset = size;
94+
#endif
9395
// Exit once we've processed the entire clip.
9496
if (offset >= size) {
9597
#if __EMSCRIPTEN__
@@ -192,7 +194,6 @@ int main(int argc, char* argv[]) {
192194
ALint srcLen = 0;
193195
alGetSourcei(source, 0x2009 /* AL_BYTE_LENGTH_SOFT */, &srcLen);
194196
assert(srcLen == NUM_BUFFERS * BUFFER_SIZE);
195-
196197
#ifdef TEST_ANIMATED_PITCH
197198
printf("You should hear a clip of the 1902 piano song \"The Entertainer\" played back at a high pitch rate, and animated to slow down to half playback speed.\n");
198199
#else

test/test_browser.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,6 +2323,17 @@ def test_openal_capture_sanity(self):
23232323
def test_openal_extensions(self):
23242324
self.btest_exit('openal/test_openal_extensions.c')
23252325

2326+
@parameterized({
2327+
'': ([],),
2328+
'proxy_to_pthread': (['-sPROXY_TO_PTHREAD', '-pthread'],),
2329+
})
2330+
def test_openal_playback(self, args):
2331+
shutil.copy(test_file('sounds/audio.wav'), '.')
2332+
self.btest('openal/test_openal_playback.c', '1', emcc_args=['-O2', '--preload-file', 'audio.wav'] + args)
2333+
2334+
def test_openal_buffers(self):
2335+
self.btest_exit('openal/test_openal_buffers.c', emcc_args=['-DTEST_FAST=1','--preload-file', test_file('sounds/the_entertainer.wav') + '@/'],)
2336+
23262337
def test_runtimelink(self):
23272338
create_file('header.h', r'''
23282339
struct point {

test/third_party/googletest

Submodule googletest updated 134 files

0 commit comments

Comments
 (0)