File: testmemorypool.cpp

package info (click to toggle)
kdevelop-pg-qt 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,284 kB
  • sloc: cpp: 22,743; lex: 928; ansic: 716; yacc: 615; ruby: 68; sh: 14; lisp: 10; fortran: 6; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
    SPDX-FileCopyrightText: 2009 Milian Wolff <mail@milianw.de>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "testmemorypool.h"

#include <cstdlib>
#include <QTest>
#include <QDebug>

#include <kdev-pg-memory-pool.h>

namespace KDevPG
{

void TestMemoryPool::initTestCase()
{
}

void TestMemoryPool::bigAlloc()
{
  MemoryPool pool;

  size_t chunkSize = 256;
  unsigned int chunks = 10000;

  for ( unsigned int i = 0; i < chunks; ++i ) {
    pool.allocate(chunkSize);
  }
}

}

QTEST_MAIN(KDevPG::TestMemoryPool)

#include "moc_testmemorypool.cpp"