File indexing completed on 2024-05-12 04:49:41

0001 /***************************************************************************
0002  *   Copyright (c) 2009 Sven Krohlas <sven@asbest-online.de>               *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  *                                                                         *
0009  *   This program is distributed in the hope that it will be useful,       *
0010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0012  *   GNU General Public License for more details.                          *
0013  *                                                                         *
0014  *   You should have received a copy of the GNU General Public License     *
0015  *   along with this program; if not, write to the                         *
0016  *   Free Software Foundation, Inc.,                                       *
0017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
0018  ***************************************************************************/
0019 
0020 #ifndef TESTMETATRACK_H
0021 #define TESTMETATRACK_H
0022 
0023 #include "core/meta/forward_declarations.h"
0024 
0025 #include <QObject>
0026 #include <QString>
0027 #include <QTemporaryDir>
0028 
0029 class TestMetaTrack : public QObject
0030 {
0031 Q_OBJECT
0032 
0033 public:
0034     TestMetaTrack();
0035     ~TestMetaTrack() override;
0036 
0037 private Q_SLOTS:
0038     void initTestCase();
0039 
0040     void testPrettyName();
0041     void testPlayableUrl();
0042     void testPrettyUrl();
0043     void testUidUrl();
0044 
0045     void testIsPlayable();
0046     void testAlbum();
0047     void testArtist();
0048     void testComposer();
0049     void testGenre();
0050     void testYear();
0051 
0052     void testComment();
0053     void testSetAndGetScore();
0054     void testSetAndGetRating();
0055     void testLength();
0056     void testFilesize();
0057     void testSampleRate();
0058     void testBitrate();
0059     void testTrackNumber();
0060     void testDiscNumber();
0061     void testLastPlayed();
0062     void testFirstPlayed();
0063     void testPlayCount();
0064     void testReplayGain();
0065     void testType();
0066 
0067     void testInCollection();
0068     void testCollection();
0069     void testSetAndGetCachedLyrics();
0070     void testOperatorEquals();
0071     void testLessThan();
0072 
0073 private:
0074     Meta::TrackPtr m_testTrack1;
0075     Meta::TrackPtr m_testTrack2;
0076     QString  m_trackPath;
0077     QTemporaryDir m_tempDir;
0078 
0079     QString dataPath( const QString &relPath );
0080 };
0081 
0082 #endif // TESTMETATRACK_H