Add tests for sf::SoundFileReader

This commit is contained in:
Chris Thrasher 2024-04-16 14:55:52 -06:00
parent 7bb97a85b1
commit cb651c063c
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include <SFML/Audio/SoundFileReader.hpp>
#include <catch2/catch_test_macros.hpp>
TEST_CASE("[Audio] sf::SoundFileReader")
{
SECTION("Type traits")
{
STATIC_CHECK(!std::is_constructible_v<sf::SoundFileReader>);
STATIC_CHECK(!std::is_copy_constructible_v<sf::SoundFileReader>);
STATIC_CHECK(std::is_copy_assignable_v<sf::SoundFileReader>);
STATIC_CHECK(!std::is_nothrow_move_constructible_v<sf::SoundFileReader>);
STATIC_CHECK(std::is_nothrow_move_assignable_v<sf::SoundFileReader>);
STATIC_CHECK(std::has_virtual_destructor_v<sf::SoundFileReader>);
}
SECTION("Info")
{
const sf::SoundFileReader::Info info;
CHECK(info.sampleCount == 0);
CHECK(info.channelCount == 0);
CHECK(info.sampleRate == 0);
}
}

View File

@ -138,6 +138,7 @@ set(AUDIO_SRC
Audio/SoundBuffer.test.cpp Audio/SoundBuffer.test.cpp
Audio/SoundBufferRecorder.test.cpp Audio/SoundBufferRecorder.test.cpp
Audio/SoundFileFactory.test.cpp Audio/SoundFileFactory.test.cpp
Audio/SoundFileReader.test.cpp
Audio/SoundRecorder.test.cpp Audio/SoundRecorder.test.cpp
Audio/SoundSource.test.cpp Audio/SoundSource.test.cpp
Audio/SoundStream.test.cpp Audio/SoundStream.test.cpp