mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-05 11:56:00 -04:00
Add some AudioSpec tests to test_wav
This commit is contained in:
parent
3018902475
commit
ed4d777f39
@ -10,9 +10,10 @@ BEGIN_TEST(int, char*[])
|
|||||||
Wav wav(TESTDATA_DIR "/test.wav");
|
Wav wav(TESTDATA_DIR "/test.wav");
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// Wav tests
|
||||||
EXPECT_EQUAL(wav.GetLength(), (Uint32)121044);
|
EXPECT_EQUAL(wav.GetLength(), (Uint32)121044);
|
||||||
EXPECT_TRUE(wav.GetBuffer() != nullptr);
|
EXPECT_TRUE(wav.GetBuffer() != nullptr);
|
||||||
EXPECT_TRUE((const Uint8*)wav.GetBuffer() == (Uint8*)wav.GetBuffer());
|
EXPECT_TRUE(wav.GetBuffer() == const_cast<const Wav&>(wav).GetBuffer());
|
||||||
|
|
||||||
const AudioSpec& spec = wav.GetSpec();
|
const AudioSpec& spec = wav.GetSpec();
|
||||||
|
|
||||||
@ -20,6 +21,15 @@ BEGIN_TEST(int, char*[])
|
|||||||
EXPECT_EQUAL((int)spec.Get()->channels, 2);
|
EXPECT_EQUAL((int)spec.Get()->channels, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const AudioSpec& spec = wav.GetSpec();
|
||||||
|
|
||||||
|
// Audiospec tests
|
||||||
|
AudioSpec spec2(spec.Get()->freq, spec.Get()->format, spec.Get()->channels, spec.Get()->samples);
|
||||||
|
|
||||||
|
EXPECT_TRUE(spec.IsSameFormat(spec2));
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Move tests
|
// Move tests
|
||||||
Uint8* buf = wav.GetBuffer();
|
Uint8* buf = wav.GetBuffer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user