
The files in this directory are provided as examples (some better than
others) and as tests of the SSLIB. What each file does is described
below:

Makefile
    This now contains default target "all" and the following:

    "all"              - All the test files, plus ones instrumented
                         with Purify.
    "noDevTests"       - Tests which do not require a DriveDevice.
    "destructiveTests" - Tests which do writing and reading to/from disk.
    "nsrTests"         - Tests which require a valid NSR disk ***

    *** For now, this means one written by an HP SureStore Optical
        20XT LAN on an "UNLOAD" operation. Also, the side of the disk
        which contains the FSDS and root ICB must be face-up. It
        should also work for SAI-initialized disks, and MAY work for
        other UDF volumes. These are NOT guaranteed (at this point) to
        work for ANY UDF volume.

Readme.txt
    This file.

ssLib.cpp

    This includes all of the .cpps for the library.

TESTS INDEPENDENT OF DRIVE DEVICE

barefTst.cpp:

    This program tests the NSR ByteArrayRef object.  All of the tests
    are done in memory and do not require a disk device of any kind.

    Usage:  barefTest                       ; no arguments

    Expected output: Each test will print to stdout what it is doing
    and whether or not the operation succeeded.

simDvTst.cpp

    This performs largely the same operations as devTest.cpp, but uses
    a simDev, which is a file emulating a device. Thus, it requires no
    real device to run.

    Usage:  simDvTst pseudoDevFile

DESTRUCTIVE TESTS:

devTest.cpp:

    This test tests the DriveDevice object as well as the PhysExtent,
    LogExtent, and LogExtentList read() and write() interfaces.  It
    performs destructive testing and requires a disk device to test
    on.

    Usage:  devTest raw_device_file

    The raw_device_file should be the device corresponding to the
    drive to perform the destructive testing upon.  If no argument is
    given, the test will attempt to use /dev/rdsk/c201d4s0.

    Expected Output:

    A large number of iterations will be printed to screen which will
    announce how many sectors are being written, read, erased, and
    verified.  he output will indicate if an iteration fails.

flipTest.cpp

    This test tests the LogExtentList manipulator routines: Head(),
    Tail(), HeadX(), and TailX().  It requires a raw device file
    argument, as it performs destructive testing to a disk to help
    perform data integrity checks.

    Usage:  flipTest raw_device_file

    The raw_device_file should be the device corresponding to the
    drive to perform the destructive testing upon.  If no argument is
    given, the test will attempt to use /dev/rdsk/c201d4s0.

    Expected Output:

    Each of the several subtests (one for each method, plus a fifth
    combining Head and Tail calls) iterates any prints to screen what
    operation it is attempting and whether the operation succeeded.

ntfTest.cpp

    Usage: ntfTest  [devfilename] [numLoops] ["SMALL"]
           devfilename defaults to 'tbox2'
           numLoops defaults to 5
           a non-empty fourth arg causes small printouts
           (default is larger printouts)

    If you give a value for an option, you must also give
    a value for all preceding options.

    Writes random Nodes to & from disk and checks that nothing changed
    in the process.  Writes to random location on the disk.
    Success: prints OK.
    Failure: prints ERROR.

srTest.cpp:

    This program tests the ISOSpaceResource class by testing the
    various allocation strategies (list-based, extent-based,
    block-aligned allocation lengths, non-block-aligned allocation
    lengths).  It performs destructive testing on a disk to help
    perform data verification.

    Usage:  srTest raw_device_file

    The raw_device_file should be the device corresponding to the
    drive to perform the destructive testing upon.  If no argument is
    given, the test will attempt to use /dev/rdsk/c201d4s0.

    Expected Output:

    The test will output to screen what operation each test iteration
    is attempting and whether it succeeded or not.

newsrTst.cpp

    This test is an interactive test used to test the ISOSpaceResource
    class.  It enables the user to create "files" in the sense that
    when each file is created, space is allocated from an
    ISOSpaceResource of fixed size (it begins with 256Kbytes), data is
    written to the "file", and CRC's performed.  When the file is
    freed, the file's data is reread and verified, and the space
    returned to the space resource.  The program uses the following
    commands:
                            
    h                       Help.
    q                       Quit.
    a size                  Allocate a file of specified size.
    f file_no               Free the specified file.
    d                       Print "directory" of files.
    p                       Print the SpaceResource.
    m [ 0 1 ]               Mode:  if 0, use Extent-based; if 1, use
                            List-based.

    When a file is created, the program will print to screen its
    number, which is a handle to be used with the free 'f' command.
    By default, the program uses extent-based allocation (i.e., space
    allocated to the file must be contiguous in a single extent).  Use
    the 'm 1' command to set it to use list-based allocation (where
    the space does not need to be contiguous).

    Usage:  srTest raw_device_file

    The raw_device_file should be the device corresponding to the
    drive to perform the destructive testing upon.  If no argument is
    given, the test will attempt to use /dev/rdsk/c201d4s0.

nodeTest.cpp

    Usage: nodeTest devfilename
      Assumes:  partition starts at sector 257

    Goes for 45 minutes, iterates 0 .. 200 ADs of short,long,extended
    type, plus embedded data. This is a brute-force test of the Node's
    to/fromDisk() functionality. Corner cases to come.

lelTest.cpp:

    This tests the LogExtentList classes. Right now, it depends upon a
    working SpaceResource, and the only one it can use is the
    LELSpaceResource, which uses the CoalescedLogExtentList, so it is
    incestuous.

bmsrTest.cpp:

    This has been provided by SAI and performs some rigorous testing
    on the BitmapSpaceResource.

    HP HAS NOT EVEN COMPILED THIS on HP-UX with g++, as it has with
    the others. On Windows/Borland and Mac/MetroWerks platforms, it
    has apparently worked well.

NSR TESTS:

adtTest.cpp

    Usage: adtTest [devfilename] [numLoops]
           devfilename defaults to 'tbox' 
           numLoops defaults to 5

    Makes random extentLists, toADTables them, fromADTables them back,
    and checks that they haven't changed in the process.
    Success:  prints OK.  Failure:  prints ERROR.

deTest.cpp

    Usage: deTest  [devfilename]
      devfilename defaults to 'tbox'

    Finds the root ICB,
    uses it to quickly set up the logical volume
    Makes random DirEntries, fromISO's them, toISO's them back
    and checks that they haven't changed in the process.
    Success:  prints OK.  Failure:  prints ERROR.

dlTest.cpp

    Usage: dlTest  [devfilename] [numLoops]     
           devfilename defaults to 'tbox'
           numLoops controls test length (default = 100)

    First it does various tests of DirList::toISO() with various buffer
    sizes and offsets.  The only one of these first tests that returns
    error_None is the test where the buffer len is exactly equal
    to the DirList ISOlen.  All others are expected to return errors
    like error_End_of_buffer.

    Then it does the loop test.  It finds the NSR root ICB,
    uses it to quickly set up the logical volume
    Makes random DirLists, fromISO's them, toISO's them back
    and checks that they haven't changed in the process.
    These loop tests almost always are expected to return ERROR because
    fromISO is being called on a buffer that isn't completely filled with
    FIDs.  See the test output for more info on this.

extTest.cpp

    This test does some simple and primitive testing of the
    LogExtentLists. SOME boundary conditions are tested. Any problems
    are indicated by an Error message.

# NSR TESTS WHICH JUST PRINT SOMETHING OUT

volPrint.cpp

    This is very simple example code for how the objects work
    together. It uses all of the objects in the Framework except for
    the Extended Attributes ones. It uses the SingleSurfaceVolume
    object to print out all of the volume information, then uses a
    DirList object to print out the root directory, and then uses the
    MasterSpaceResource object to print out the free space
    information.

Usage:  ./volPrint [-f devfile] [-lrsxtv]
 -l : Print Volume Label Information
 -r : Print Root Directory
 -s : Print Free Space Information
 -x : Print Execution of this test
 -t : Print Algorithm flow in UDF Object Framework
 -v : Print all the above




