core/audio: Rename audio_get_player() to test_audio_player()
Also, let's only have this function when CONFIG_TESTING is enabled. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
2586348921
commit
ed5f035855
|
@ -248,7 +248,9 @@ void audio_pause_after(int n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GstElement *audio_get_player()
|
#ifdef CONFIG_TESTING
|
||||||
|
GstElement *test_audio_player()
|
||||||
{
|
{
|
||||||
return audio_player;
|
return audio_player;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_TESTING */
|
||||||
|
|
|
@ -67,5 +67,7 @@ void audio_error(GstMessage *);
|
||||||
/* Called to configure automatic pausing. */
|
/* Called to configure automatic pausing. */
|
||||||
void audio_pause_after(int);
|
void audio_pause_after(int);
|
||||||
|
|
||||||
GstElement *audio_get_player();
|
#ifdef CONFIG_TESTING
|
||||||
|
GstElement *test_audio_player();
|
||||||
|
#endif /* CONFIG_TESTING */
|
||||||
#endif /* OCARINA_CORE_AUDIO_H */
|
#endif /* OCARINA_CORE_AUDIO_H */
|
||||||
|
|
|
@ -29,7 +29,7 @@ static void test_send_error()
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = g_error_new(1, G_FILE_ERROR_BADF, "Simulated Error");
|
error = g_error_new(1, G_FILE_ERROR_BADF, "Simulated Error");
|
||||||
message = gst_message_new_error(GST_OBJECT(audio_get_player()),
|
message = gst_message_new_error(GST_OBJECT(test_audio_player()),
|
||||||
error, "Error generated for testing");
|
error, "Error generated for testing");
|
||||||
audio_error(message);
|
audio_error(message);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static struct core_init_data test_init_data = {
|
||||||
|
|
||||||
static void test_init()
|
static void test_init()
|
||||||
{
|
{
|
||||||
test_equal((void *)audio_get_player(), NULL);
|
test_equal((void *)test_audio_player(), NULL);
|
||||||
test_equal((void *)audio_cur_track(), NULL);
|
test_equal((void *)audio_cur_track(), NULL);
|
||||||
test_equal(audio_cur_state(), GST_STATE_NULL);
|
test_equal(audio_cur_state(), GST_STATE_NULL);
|
||||||
test_equal((void *)audio_next(), NULL);
|
test_equal((void *)audio_next(), NULL);
|
||||||
|
@ -86,7 +86,7 @@ static void test_init()
|
||||||
while (idle_run_task()) {};
|
while (idle_run_task()) {};
|
||||||
|
|
||||||
test_equal((void *)audio_cur_track(), NULL);
|
test_equal((void *)audio_cur_track(), NULL);
|
||||||
test_not_equal((void *)audio_get_player(), NULL);
|
test_not_equal((void *)test_audio_player(), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_playback()
|
static void test_playback()
|
||||||
|
@ -239,7 +239,7 @@ static void test_deinit()
|
||||||
{
|
{
|
||||||
core_deinit();
|
core_deinit();
|
||||||
test_equal((void *)audio_cur_track(), NULL);
|
test_equal((void *)audio_cur_track(), NULL);
|
||||||
test_equal((void *)audio_get_player(), NULL);
|
test_equal((void *)test_audio_player(), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue