MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
main.cpp
1 /*
2  Copyright (C) 2003-2006 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program 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
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include <ndb_global.h>
20 
21 #include <ArrayList.hpp>
22 #include <NdbOut.hpp>
23 #include <NdbTick.h>
24 #include <NdbMain.h>
25 
26 #include "arrayListTest.cpp"
27 #include "arrayPoolTest.cpp"
28 
29 NDB_COMMAND(al_test, "al_test", "al_test", "al_test", 65535)
30 {
31  NdbMem_Create();
32  srand(NdbTick_CurrentMillisecond());
33 
34 #if 1
35  ndbout << endl << endl << "-- Testing basic basic seize/release" << endl;
36  ArrayListTest::tryList0(10);
37 
38  ndbout << endl << endl << "-- Testing basic seize/release" << endl;
39  ArrayListTest::tryList1(1000, 1000);
40 
41  ndbout << endl << endl << "-- Testing that seize returns RNIL"
42  << endl;
43  ArrayListTest::tryList1(10, 1000000);
44 
45  ndbout << endl << endl << "-- Testing access out of array" << endl;
46  ArrayListTest::tryList2(1000, 100000, 5);
47 #endif
48 
49 #if 1
50  ndbout << endl << endl << "-- Testing basic seize/release" << endl;
51  ArrayPoolTest::tryPool1(1000, 1000);
52 
53  ndbout << endl << endl << "-- Testing that seize returns RNIL"
54  << endl;
55  ArrayPoolTest::tryPool1(10, 1000000);
56 
57  ndbout << endl << endl << "-- Testing access out of array" << endl;
58  ArrayPoolTest::tryPool2(1000, 100000, 5);
59 
60  ndbout << endl << endl << "-- Testing releasing none seized element" << endl;
61  ArrayPoolTest::tryPool3(1000, 5);
62 #endif
63 }
64 
65 void
66 ErrorReporter::handleBlockAssert(int line)
67 {
68  ndbout << "ErrorReporter::handleAssert activated - "
69  << " line= " << line << endl;
70  //assert(0);
71 }