# HG changeset patch # User Edgar Simo # Date 1250531562 0 # Node ID 427f059bc8149988c35bacdf9466630b6644783e # Parent e04d9c69a6fd53edb83b041fb389934762be95e7 Added simple audio test. diff -r e04d9c69a6fd -r 427f059bc814 test/automated/Makefile --- a/test/automated/Makefile Thu Aug 06 17:00:07 2009 +0000 +++ b/test/automated/Makefile Mon Aug 17 17:52:42 2009 +0000 @@ -11,11 +11,17 @@ rwops/rwops.c \ platform/platform.c \ surface/surface.c \ - render/render.c + render/render.c \ + audio/audio.c COMMON_SRC := SDL_at.c common/common.c COMMON_INCLUDE := SDL_at.h -TESTS_ALL := testsdl rwops/rwops platform/platform surface/surface render/render +TESTS_ALL := testsdl \ + rwops/rwops \ + platform/platform \ + surface/surface \ + render/render \ + audio/audio .PHONY: all clean test @@ -41,5 +47,8 @@ render/render: render/render.c $(COMMON_INCLUDE) $(COMMON_SRC) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ render/render.c $(COMMON_SRC) -DTEST_STANDALONE +audio/audio: audio/audio.c $(COMMON_INCLUDE) $(COMMON_SRC) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ audio/audio.c $(COMMON_SRC) -DTEST_STANDALONE + clean: $(RM) $(TESTS_ALL) diff -r e04d9c69a6fd -r 427f059bc814 test/automated/audio/audio.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/automated/audio/audio.c Mon Aug 17 17:52:42 2009 +0000 @@ -0,0 +1,89 @@ +/** + * Automated SDL_RWops test. + * + * Written by Edgar Simo "bobbens" + * + * Released under Public Domain. + */ + + +#include "SDL.h" +#include "SDL_at.h" + + +/** + * @brief Prints available devices. + */ +static int audio_printDevices( int iscapture ) +{ + int i, n; + + /* Get number of devices. */ + n = SDL_GetNumAudioDevices(iscapture); + SDL_ATprintVerbose( 1, "%d %s Audio Devices\n", + n, iscapture ? "Capture" : "Output" ); + + /* List devices. */ + for (i=0; i /* printf */ #include /* exit */ @@ -32,6 +33,7 @@ static int run_rwops = 1; /**< Run RWops tests. */ static int run_surface = 1; /**< Run surface tests. */ static int run_render = 1; /**< Run render tests. */ +static int run_audio = 1; /**< Run audio tests. */ /* * Prototypes. @@ -52,6 +54,7 @@ printf(" --norwops do not run the rwops tests\n"); printf(" --nosurface do not run the surface tests\n"); printf(" --norender do not run the render tests\n"); + printf(" --noaudio do not run the audio tests\n"); printf(" -v, --verbose increases verbosity level by 1 for each -v\n"); printf(" -q, --quiet only displays errors\n"); printf(" -h, --help display this message and exit\n"); @@ -69,6 +72,7 @@ { "norwops", no_argument, 0, 0 }, { "nosurface", no_argument, 0, 0 }, { "norender", no_argument, 0, 0 }, + { "noaudio", no_argument, 0, 0 }, { "verbose", no_argument, 0, 'v' }, { "quiet", no_argument, 0, 'q' }, { "help", no_argument, 0, 'h' }, @@ -96,6 +100,8 @@ run_surface = 0; else if (strcmp(str,"norender")==0) run_render = 0; + else if (strcmp(str,"noaudio")==0) + run_audio = 0; break; /* Manual. */ @@ -154,6 +160,8 @@ failed += test_surface(); if (run_render) failed += test_render(); + if (run_audio) + failed += test_audio(); /* Manual tests. */ if (run_manual) {