xref: /illumos-gate/usr/src/lib/fm/libdiagcode/common/tests/README (revision 86d949f9497332fe19be6b5d711d265eb957439f)
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
27These are sample DIAGCODE dictionary files, used only when the
28	make test
29target is built in the libdiagcode source area.  These files have
30special comments embedded in them that the test driver (tstdiagcode.c)
31uses to tell it what tests to run against each dictionary.  These
32tests can be used to regression test libdiagcode after a bug fix.
33If you add a feature to libdiagcode, you should add the appropriate
34unit tests here.
35
36Since DIAGCODE dictionaries allow comments with the '#' character,
37the test driver looks for directives in the comments.  The directive
38comments start with:
39
40	#TEST:
41
42and then have a colon-separated list of arguments.  The first argument
43is the function the test driver should call: open, close, codelen, maxkey,
44key2code, code2key, or getprop.  The second argument is the errno expected
45on return, or zero if no errno is expected.  The next two arguments specify
46input and output parameters to the function, and are in formats specific
47to each function.  For example:
48
49	#TEST:key2code:0:fault.one fault.two:SAMPLE0-8000-5V
50
51The above line tells the test driver to call fm_dc_key2code() with the key[]
52array set to "fault.one" and "fault.two" (in that order) and expect
53a non-error return, with the code SAMPLE0-8000-5V filled in.
54