File indexing completed on 2024-04-28 08:27:25

0001 /*
0002     <one line to give the program's name and a brief idea of what it does.>
0003     Copyright (C) <year>  <name of author>
0004 
0005     This program is free software; you can redistribute it and/or modify
0006     it under the terms of the GNU General Public License as published by
0007     the Free Software Foundation; either version 2 of the License, or
0008     (at your option) any later version.
0009 
0010     This program is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013     GNU General Public License for more details.
0014 
0015     You should have received a copy of the GNU General Public License along
0016     with this program; if not, write to the Free Software Foundation, Inc.,
0017     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0018 
0019 */
0020 
0021 #include "testmemorypool.h"
0022 
0023 #include <cstdlib>
0024 #include <QTest>
0025 #include <QDebug>
0026 
0027 #include "../include/kdev-pg-memory-pool.h"
0028 
0029 namespace KDevPG
0030 {
0031 
0032 void TestMemoryPool::initTestCase()
0033 {
0034 }
0035 
0036 void TestMemoryPool::bigAlloc()
0037 {
0038   MemoryPool pool;
0039 
0040   size_t chunkSize = 256;
0041   unsigned int chunks = 10000;
0042 
0043   for ( unsigned int i = 0; i < chunks; ++i ) {
0044     pool.allocate(chunkSize);
0045   }
0046 }
0047 
0048 }
0049 
0050 QTEST_MAIN(KDevPG::TestMemoryPool)
0051 
0052 #include "moc_testmemorypool.cpp"