summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/test/AudioConfig.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-03-07 23:59:51 +0100
committerAki <please@ignore.pl>2024-03-07 23:59:51 +0100
commit3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19 (patch)
tree4a2724f89ce213b1834d5550229243cccfad9fb3 /StarsEx/test/AudioConfig.cpp
parent1ef05b8b227194ec32ae49f0eaf3e483ef35bb6b (diff)
downloadstarshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.zip
starshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.tar.gz
starshatter-3f857bb284d3c8aa99bcd61980e0f0cab2dd8e19.tar.bz2
Added gtest to the project and a stub test for showcase
Diffstat (limited to 'StarsEx/test/AudioConfig.cpp')
-rw-r--r--StarsEx/test/AudioConfig.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/StarsEx/test/AudioConfig.cpp b/StarsEx/test/AudioConfig.cpp
new file mode 100644
index 0000000..f6a05d4
--- /dev/null
+++ b/StarsEx/test/AudioConfig.cpp
@@ -0,0 +1,16 @@
+#include <gtest/gtest.h>
+
+#include <AudioConfig.h>
+
+
+TEST(StarsEx, AudioConfig)
+{
+ AudioConfig audio; // as a side-effect constructor sets the static instance
+ ASSERT_EQ(&audio, AudioConfig::GetInstance());
+ audio.SetMenuMusic(100);
+ ASSERT_EQ(0, AudioConfig::MenuMusic());
+ audio.SetMenuMusic(50);
+ ASSERT_EQ(-2500, AudioConfig::MenuMusic());
+ audio.SetMenuMusic(0);
+ ASSERT_EQ(-5000, AudioConfig::MenuMusic());
+}