commit b3f6aa7160a1e71a9840316d874cecd07c5ffade
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Wed Sep 9 20:45:57 2020 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Tue Sep 15 17:09:08 2020 -0600
Add a few more basic audio tests
---
test/audiotests.cpp | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/test/audiotests.cpp b/test/audiotests.cpp
index ed27cd0..3b28e40 100644
--- a/test/audiotests.cpp
+++ b/test/audiotests.cpp
@@ -24,5 +24,32 @@ TEST_CASE("audio class behaves as expected") {
CHECK_EQ(picoRam._sfxChannels[0].sfxId, sfxId);
}
+ SUBCASE("api_sfx() with -1 channel finds first available") {
+ audio->api_sfx(1, 0, 0);
+ audio->api_sfx(2, 1, 0);
+ audio->api_sfx(5, -1, 0);
+
+
+ CHECK_EQ(picoRam._sfxChannels[2].sfxId, 5);
+ }
+ SUBCASE("api_sfx() -2 sfx id stops looping") {
+ picoRam._sfxChannels[3].can_loop = true;
+
+ audio->api_sfx(-2, 3, 0);
+
+ CHECK_EQ(picoRam._sfxChannels[3].can_loop, false);
+ }
+ SUBCASE("api_sfx() -2 sfx id stops looping") {
+ picoRam._sfxChannels[3].can_loop = true;
+
+ audio->api_sfx(-2, 3, 0);
+
+ CHECK_EQ(picoRam._sfxChannels[3].can_loop, false);
+ }
+ SUBCASE("api_music sets music pattern"){
+ audio->api_music(14, 0, 0);
+
+ CHECK_EQ(picoRam._musicChannel.pattern, 14);
+ }
}
\ No newline at end of file