// ---------------------------------------------------------------------- // // testZMutility.cc // // Validate selected ZMutility header files. // // History: // 28-Oct-1997 WEB Initial draft. // 04-Nov-1997 WEB Updated to correspond to new file names, etc. // 11-Dec-1997 WEB Added testing for correctness of "algorithm" // 12-Jan-1998 WEB Added testing for "PI.h" // 14-Feb-2000 WEB Remove semicolons after USING // // ---------------------------------------------------------------------- // [0] #include "ZMutility/ZMenvironment.h" // [1] #include "ZMutility/iosfwd" #include "ZMutility/iostream" USING (std::cout) USING (std::endl) // [2] #include USING (std::string) // [3] #include "ZMutility/iomanip" USING (std::setw) // [4] #include "ZMutility/sstream" USING (std::ostringstream) // [5] #include "ZMutility/algorithm" USING (std::swap) // [6] #include "ZMutility/PI.h" int main() { // [0] Precautionary // [1] Validate iosfwd and iostream: cout << "iosfwd and iostream appear to work" << endl; // [2] Validate string: string s = "string appears to work"; cout << s << endl; // [3] Validate iomanip: cout << setw(3) << 9 << " iomanip appears to work if the '9' has 2 spaces before it" << endl; // [4] Validate ostream: ostringstream * o = new ostringstream; (*o) << "ostringstream appears to work"; cout << o->str() << endl; delete o; // [5] Validate algorithm: int a = 1, b = 2; swap( a, b ); cout << "algorithm appears to work if " << a << " > " << b << endl; // [6] Validate PI: cout << "PI.h appears to work if " << ZMpi << " approximates PI" << endl; // [7] Go home: return 0; } // main()