testing overloaded assignment operator within a class
Posted on 2005-05-11
I am trying to create a test class to test my overloaded functions and can't seem to call the operator functions correctly.
Here is my function for the assignment operator test for my complex number program:
void ComplexTest::test_AssignmentOp(const Complex& ct)
cout << "Testing complex assignemnt operator..." << endl;
if (_complex.operator =(ct.operator =)
cout << "Passes assignment operator test!" << endl;
else cout << "Failed assignment operator test!" << endl;
How do I test that opertaor-what needs to go on the right of it. The program works fine I am just trying to add this test class to it. Any ideas? Thanks!