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

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Maximilian Kossick <maximilian.kossick@googlemail.com>            *
0003  * Copyright (c) 2011 Ralf Engels <ralf-engels@gmx.de>                                  *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef TESTMEMORYQUERYMAKER_H
0019 #define TESTMEMORYQUERYMAKER_H
0020 
0021 #include<QTest>
0022 
0023 #include "core/meta/forward_declarations.h"
0024 #include "core/collections/QueryMaker.h"
0025 
0026 #include "core-impl/collections/support/MemoryCollection.h"
0027 #include "core-impl/collections/support/MemoryFilter.h"
0028 #include "core-impl/collections/support/MemoryQueryMaker.h"
0029 
0030 
0031 class TestMemoryQueryMaker : public QObject
0032 {
0033     Q_OBJECT
0034 public:
0035     TestMemoryQueryMaker();
0036 
0037 private Q_SLOTS:
0038     void initTestCase();
0039     void cleanupTestCase();
0040 
0041     void testDeleteQueryMakerWhileQueryIsRunning();
0042     void testDeleteCollectionWhileQueryIsRunning();
0043 
0044     void testStringMemoryFilterSpeedFullMatch();
0045     void testStringMemoryFilterSpeedMatchBegin();
0046     void testStringMemoryFilterSpeedMatchEnd();
0047     void testStringMemoryFilterSpeedMatchAnywhere();
0048 
0049     void testFilterTitle();
0050     void testFilterRating();
0051     void testFilterAnd();
0052     void testFilterFormat();
0053 
0054 private:
0055     Meta::TrackList executeQueryMaker( Collections::QueryMaker *qm );
0056 
0057     QSharedPointer<Collections::MemoryCollection> m_mc;
0058 };
0059 
0060 #endif // TESTMEMORYQUERYMAKER_H