MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pfs_instr_class-oom-t.cc
1 /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 #include <my_global.h>
17 #include <my_pthread.h>
18 #include <pfs_instr_class.h>
19 #include <pfs_global.h>
20 #include <tap.h>
21 
22 #include "stub_pfs_global.h"
23 #include "stub_server_misc.h"
24 
25 void test_oom()
26 {
27  int rc;
28 
29  rc= init_sync_class(1000, 0, 0);
30  ok(rc == 1, "oom (mutex)");
31  rc= init_sync_class(0, 1000, 0);
32  ok(rc == 1, "oom (rwlock)");
33  rc= init_sync_class(0, 0, 1000);
34  ok(rc == 1, "oom (cond)");
35  rc= init_thread_class(1000);
36  ok(rc == 1, "oom (thread)");
37  rc= init_file_class(1000);
38  ok(rc == 1, "oom (file)");
39  rc= init_table_share(1000);
40  ok(rc == 1, "oom (cond)");
41  rc= init_socket_class(1000);
42  ok(rc == 1, "oom (socket)");
43  rc= init_stage_class(1000);
44  ok(rc == 1, "oom (stage)");
45  rc= init_statement_class(1000);
46  ok(rc == 1, "oom (statement)");
47 
55 }
56 
57 void do_all_tests()
58 {
60 
61  test_oom();
62 
64 }
65 
66 int main(int, char **)
67 {
68  plan(9);
69  MY_INIT("pfs_instr_info-oom-t");
70  do_all_tests();
71  return 0;
72 }
73