From cb651c063caa61aece39bbb27916623070f7935f Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 16 Apr 2024 14:55:52 -0600 Subject: [PATCH] Add tests for `sf::SoundFileReader` --- test/Audio/SoundFileReader.test.cpp | 24 ++++++++++++++++++++++++ test/CMakeLists.txt | 1 + 2 files changed, 25 insertions(+) create mode 100644 test/Audio/SoundFileReader.test.cpp diff --git a/test/Audio/SoundFileReader.test.cpp b/test/Audio/SoundFileReader.test.cpp new file mode 100644 index 000000000..906901073 --- /dev/null +++ b/test/Audio/SoundFileReader.test.cpp @@ -0,0 +1,24 @@ +#include + +#include + +TEST_CASE("[Audio] sf::SoundFileReader") +{ + SECTION("Type traits") + { + STATIC_CHECK(!std::is_constructible_v); + STATIC_CHECK(!std::is_copy_constructible_v); + STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(!std::is_nothrow_move_constructible_v); + STATIC_CHECK(std::is_nothrow_move_assignable_v); + STATIC_CHECK(std::has_virtual_destructor_v); + } + + SECTION("Info") + { + const sf::SoundFileReader::Info info; + CHECK(info.sampleCount == 0); + CHECK(info.channelCount == 0); + CHECK(info.sampleRate == 0); + } +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f5a81ec17..4051c4cbe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -138,6 +138,7 @@ set(AUDIO_SRC Audio/SoundBuffer.test.cpp Audio/SoundBufferRecorder.test.cpp Audio/SoundFileFactory.test.cpp + Audio/SoundFileReader.test.cpp Audio/SoundRecorder.test.cpp Audio/SoundSource.test.cpp Audio/SoundStream.test.cpp