Initial testing support
Added the ability to compile a subset of functions in to a test executable for Linux. To be used in the future for testing. Removed unnecessary includes. Tested working by compiling test executable for GNU/Linux and for the 3DS. The 3dsx was tested in citra. Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#include <3ds.h>
|
||||
|
||||
#define DR_FLAC_IMPLEMENTATION
|
||||
#include <./dr_libs/dr_flac.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <3ds.h>
|
||||
#include <mpg123.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdint.h>
|
||||
#include "playback.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <3ds.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef ctrmus_playback_h
|
||||
#define ctrmus_playback_h
|
||||
|
||||
|
||||
63
source/test.c
Normal file
63
source/test.c
Normal file
@@ -0,0 +1,63 @@
|
||||
#if defined __gnu_linux__
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "flac.h"
|
||||
#include "mp3.h"
|
||||
#include "opus.h"
|
||||
#include "playback.h"
|
||||
#include "vorbis.h"
|
||||
#include "wav.h"
|
||||
#include "playback.h"
|
||||
|
||||
/**
|
||||
* Test the various decoder modules in ctrmus.
|
||||
*/
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct decoder_fn decoder;
|
||||
|
||||
if(argc != 2)
|
||||
{
|
||||
puts("FILE is required.");
|
||||
printf("%s FILE\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
switch(getFileType(argv[1]))
|
||||
{
|
||||
case FILE_TYPE_WAV:
|
||||
setWav(&decoder);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_FLAC:
|
||||
setFlac(&decoder);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_OPUS:
|
||||
setOpus(&decoder);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_MP3:
|
||||
setMp3(&decoder);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_VORBIS:
|
||||
setVorbis(&decoder);
|
||||
break;
|
||||
|
||||
default:
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
puts("Error");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
#pragma message ( "Test ignored for 3DS build." )
|
||||
#endif
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <3ds.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <3ds.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdint.h>
|
||||
#include "playback.h"
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user