CS 102 Laboratory Session Four

This is the week Five Lab session, worth 5 points total.

Testing a Class Implementation

A program or function that is used to test another function or a class is often called an automated test sequence (ATS). To test a class, each member function of the class must be tested, including the default constructor, copy constructor, and destructor. The 3D geometry library (linked below) already contains some ATS in the GeomDemo.cpp file which you may examine and execute.

Write a program to test the implementation of the Polygon3D class in the geometry library:

Test the following functions (one point each):

  1. General constructor.
  2. Copy constructor.
  3. The addEdge() function.
  4. The setEdge() function.
  5. The assignment operator.

You may use any of the existing test code linked above that you want. The class has not been fully tested and you may find bugs.



This page established September 18, 1999; last updated January 6, 2K, by Rick Wagner.