1 /*
2  * Copyright (C) 2020 Meltytech, LLC
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with consumer library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 
19 #include <QString>
20 #include <QtTest>
21 
22 #include <mlt++/Mlt.h>
23 using namespace Mlt;
24 
25 class TestAudio : public QObject
26 {
27 	Q_OBJECT
28 
29 private Q_SLOTS:
30 
DefaultConstructor()31 	void DefaultConstructor()
32 	{
33 		Audio a;
34 		QVERIFY(a.samples() == 0);
35 	}
36 
ConstructFromAudio()37 	void ConstructFromAudio()
38 	{
39 		mlt_audio audio = mlt_audio_new();
40 		audio->samples = 500;
41 		Audio a(audio);
42 		QVERIFY(a.samples() == 500);
43 	}
44 
GetSetData()45 	void GetSetData()
46 	{
47 		Audio a;
48 		void* data = malloc(500);
49 		a.set_data(data);
50 		QVERIFY(a.data() == data);
51 		free(data);
52 		a.set_data(nullptr);
53 	}
54 };
55 
56 QTEST_APPLESS_MAIN(TestAudio)
57 
58 #include "test_audio.moc"
59