#include #include #include #include #include // SDL_main #include #include #include #include char* argv0; TEST(soloud_fs_file, basic) { MM::Engine engine; // setup auto& sound = engine.addService(); ASSERT_TRUE(engine.enableService()); auto& fs = engine.addService(argv0, "soloud_filesystem_file_test"); ASSERT_TRUE(engine.enableService()); sound.engine.setGlobalVolume(0.4f); { const char* file_path = "does_not_exist.wav"; ASSERT_FALSE(fs.exists(file_path)); MM::SoLoud::FilesystemFile sl_f(fs.open(file_path), engine); SoLoud::Wav w; ASSERT_EQ(w.loadFile(&sl_f), SoLoud::SOLOUD_ERRORS::FILE_LOAD_FAILED); } while (sound.engine.getActiveVoiceCount()) { } } int main(int argc, char** argv) { argv0 = argv[0]; ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }