ftp.nice.ch/pub/next/developer/resources/libraries/LGDCommunicationKit.1.0.N.a.tar.gz#/LGDCommunicationKit-1.0/Examples/self-test

Makefile
 
Makefile.postamble
 
Makefile.preamble
 
PB.gdbinit
 
PB.project
 
README.rtf
[View README.rtf] 
self-test.m
[View self-test.m] 
test_suite.h
[View test_suite.h] 
test_suite.m
[View test_suite.m] 

README.rtf

README.rtf
LGDCommunicationKit, Release 1.0 (prerelease)
Examples/self-test

Copyright © 1993, Looking Glass Design, Inc.
All rights reserved.

Project Manager:	Paul Girone
Original Author: 	Mike Gobbi
Creation Date:	June 26, 1993
$Revision: 1.3 $

The self-test program puts the LGDSerialPort object through its paces, and at the end produces a count of the number of errors or possible errors encountered.

Execution

To execute this program (after making) enter
	% self-test
or
	% self-test device
where device is the name of the serial device to use when performing the test.  This should be one of cufa, cufb, cua, or cub, and there must be a hayes-compatible modem connected to the serial port corresponding to the device (A or B, depending on the last letter of the device name).

While executing, the test program prints out diagnostics and prompts the user for information about the status of the indicator LED's on the front of the modem.  Note that on most modems, the BREAK condition is indicated by raising the TXD and RXD lines simultaneously.

A comment about permissions

If the self-test fails to execute completely, it is likely that you do not have permission to open the devices.  If this is the case, ask your system administrator to do one of the following:
1.	Set the permissions of the devices to o+w.  This creates a potential security hole, but it provides the most protection against accidentally damaging or altering the system.
2.	Modify the executable to be setuid uucp.  This is an attractive option, since it is likely that any applications written which use the LGDSerialPort object will be running as uucp anyway.  On the other hand, if you create custom programs that run as uucp you take the risk of accidentally damaging files used by uucp.
3.	Change the ownerships of the devices to your username.  This is strongly discouraged, since it will probably cause many unix programs to fail when they are executed.
4.	Execute the self-test as root.  This is strongly discouraged.
We recommend that the first of the four options be used.  For a more detailed discussion of permissions see LGDSerialPort.rtf.

Test coverage

The self-test covers the following areas:
	·	device locking/unlocking
	·	device opening/closing
	· communication via blocks, strings, and characters
	· buffers and flushing
	· signals
The self-test does not cover the various serial port settings (baud rate, echo, etc.), since to test these would require a more sophisticated hardware component than a simple modem.  For those who have the hardware for complex testing, it is a fairly straightforward matter to write the code to test this functionality as well.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.