Commit 0bd0e2f9 authored by James Knee's avatar James Knee
Browse files

updated overload tests of >>

parent c70b6f1a
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <string>
#include <cstring>
#include <cmath>
#include <sstream>

#include "Support/Common.h"

@@ -24,14 +25,17 @@ bool test_labFour_pZero(){
    person3.setBirthday("2000-01-03");
    person3.setSalary(100000);

    labFour_pZero_Person person4();
    labFour_pZero_Student person5();
    labFour_pZero_Instructor person6();
    labFour_pZero_Person person4;
    labFour_pZero_Student person5;
    labFour_pZero_Instructor person6;

    person4 >> "Pleiade" >> "2004-02-26";
    person5 >> "Jake" >> "2000-11-22" >> "Computer Science";
    person6 >> "Olivia" >> "2000-01-30" >> 123456;
    stringstream input0("Pleiade 2004-02-26");
    stringstream input1("Jake 2000-11-22 Computer_Science");
    stringstream input2("Olivia 2000-01-30 123456");

    input0 >> person4;
    input1 >> person5;
    input2 >> person6;

    Common::redirIO();
    cout << person4;
@@ -93,7 +97,7 @@ bool test_labFour_pZero(){
        return false;
    }

    if(output1.find("Jake")==string::npos || output1.find("2000-11-22")==string::npos || output1.find("Computer Science")==string::npos){
    if(output1.find("Jake")==string::npos || output1.find("2000-11-22")==string::npos || output1.find("Computer_Science")==string::npos){
        cout << "Test 0j failed" << endl;
        return false;
    }