4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/param.h>
32 #include <config_admin.h>
34 #include "mema_test.h"
36 extern mtest_func_t memory_test_normal
;
37 extern mtest_func_t memory_test_quick
;
38 extern mtest_func_t memory_test_extended
;
41 * Default test is first entry in the table (MTEST_DEFAULT_TEST).
43 struct mtest_table_ent mtest_table
[] = {
44 {"normal", memory_test_normal
},
45 {"quick", memory_test_quick
},
46 {"extended", memory_test_extended
},
49 static char **opt_array
;
52 mtest_build_opts(int *maxerr_idx
)
54 if (opt_array
== NULL
) {
57 * Test "type" options here, max_errors should be the
60 nopts
= sizeof (mtest_table
) / sizeof (mtest_table
[0]);
64 * One extra option for "max_errors"
66 opt_array
= (char **)malloc((nopts
+ 2) * sizeof (*opt_array
));
67 if (opt_array
!= NULL
) {
70 for (i
= 0; i
< nopts
; i
++)
71 opt_array
[i
] = (char *)mtest_table
[i
].test_name
;
73 opt_array
[nopts
] = "max_errors";
74 opt_array
[nopts
+ 1] = NULL
;
77 *maxerr_idx
= sizeof (mtest_table
) / sizeof (mtest_table
[0]);