Exemplo n.º 1
0
int main()
{
    PointDistance pd;
    vector<int> vd;
    int x1 = 0, y1 = 1, x2 = 2, y2 = 3;

    //int x1 = 1, y1 = 1, x2 = -1, y2 = -1;

    vd = pd.findPoint(x1,y1,x2,y2);

    return 0;
}
Exemplo n.º 2
0
bool do_test(int x1, int y1, int x2, int y2, vector<int> __expected) {
    time_t startClock = clock();
    PointDistance *instance = new PointDistance();
    vector<int> __result = instance->findPoint(x1, y1, x2, y2);
    double elapsed = (double)(clock() - startClock) / CLOCKS_PER_SEC;
    delete instance;

    if (__result == __expected) {
        cout << "PASSED!" << " (" << elapsed << " seconds)" << endl;
        return true;
    }
    else {
        cout << "FAILED!" << " (" << elapsed << " seconds)" << endl;
        cout << "           Expected: " << to_string(__expected) << endl;
        cout << "           Received: " << to_string(__result) << endl;
        return false;
    }
}