xref: /titanic_41/usr/src/lib/fm/libdiagcode/common/tests/README (revision 355b4669e025ff377602b6fc7caaf30dbc218371)
1#
2# CDDL HEADER START
3#
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
7# with the License.
8#
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.
13#
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]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28#
29
30These are sample DIAGCODE dictionary files, used only when the
31	make test
32target is built in the libdiagcode source area.  These files have
33special comments embedded in them that the test driver (tstdiagcode.c)
34uses to tell it what tests to run against each dictionary.  These
35tests can be used to regression test libdiagcode after a bug fix.
36If you add a feature to libdiagcode, you should add the appropriate
37unit tests here.
38
39Since DIAGCODE dictionaries allow comments with the '#' character,
40the test driver looks for directives in the comments.  The directive
41comments start with:
42
43	#TEST:
44
45and then have a colon-separated list of arguments.  The first argument
46is the function the test driver should call: open, close, codelen, maxkey,
47key2code, code2key, or getprop.  The second argument is the errno expected
48on return, or zero if no errno is expected.  The next two arguments specify
49input and output parameters to the function, and are in formats specific
50to each function.  For example:
51
52	#TEST:key2code:0:fault.one fault.two:SAMPLE0-8000-5V
53
54The above line tells the test driver to call fm_dc_key2code() with the key[]
55array set to "fault.one" and "fault.two" (in that order) and expect
56a non-error return, with the code SAMPLE0-8000-5V filled in.
57