informix
DataBlade Developers Kit User's Guide
Creating DataBlade Objects Using BladeSmith

Adding Functional Test Data

You can perform functional tests on your DataBlade module routines using the functional tests generated by BladeSmith. You must enter test data for functional tests in BladeSmith. You run functional tests on UNIX, or you run them on Windows NT using a UNIX-compatible toolkit, such as MKS Toolkit.

Tip: You can also generate unit tests, which run on Windows NT with the DBDK Visual C++ Add-In. See Debugging Your DataBlade Module for more information.

You can add functional test data for opaque type support routines, user-defined routines, and cast support functions. Using the test data you enter, BladeSmith generates a functional test for each routine. BladeSmith creates UNIX shell scripts and SQL scripts to create test tables in a database, populate them with your test data, and run SQL scripts that execute the DataBlade module routines.

BladeSmith generates functional tests for an object only if you enter test data for it. You must regenerate functional tests whenever you add test data to update the functional test scripts.

Chapter 9, Debugging and Testing DataBlade Modules on UNIX, describes how to use the functional tests that BladeSmith generates.

To enter test data for an object, select the object and choose Edit Gather Test Data.

The following sections describe the test data you enter in BladeSmith.

Test Data for Opaque Type Support Routines

To enter test data for an opaque type support routine, select the routine and choose Edit Gather Test Data.

For opaque type support routines, each test data item includes the following elements:

Enter values to test the opaque type boundaries. For example, if a type does not accept negative input values, enter test data with negative values and specify the error code you expect to receive from the text input routine.

The data you enter for an opaque type is used to test all of the supporting routines defined for the type. BladeSmith generates SQL scripts to test each supporting routine, including the text input and output routines and other routines, such as binary input and output routines and comparison routines. Add test data values that thoroughly test each of these routines.

Test Data for User-Defined Routines

To enter test data for a routine, select the routine and choose Edit Gather Test Data.

The test data for user-defined routines includes the following items:

For example, the Circle DataBlade module defines a Contains() function that takes a Circle value and a Pnt value and returns a Boolean result. To test the Contains() function with a Circle value of '(12,12,2)' and a Pnt value of '(12,12)', enter the following input parameters:

Calling Contains() with these values should return a true result, which you can enter as t. Because the input parameters are valid, you leave the Error code field blank.

Test Data for Cast Support Routines

To enter test data for a cast support function, select the cast and choose Edit Gather Test Data.

The test data for a cast support functions includes the following items:

Enter invalid input values and values that test boundary conditions for the data type.


DataBlade Developers Kit User's Guide, Version 4.0
Copyright © 1999, Informix Software, Inc. All rights reserved