bool KawigiEdit_RunTest(int testNum, int p0, int p1, int p2, bool hasAnswer, string p3) {
	cout << "Test " << testNum << ": [" << p0 << "," << p1 << "," << p2;
	cout << "]" << endl;
	PeopleCircle *obj;
	string answer;
	obj = new PeopleCircle();
	clock_t startTime = clock();
	answer = obj->order(p0, p1, p2);
	clock_t endTime = clock();
	delete obj;
	bool res;
	res = true;
	cout << "Time: " << double(endTime - startTime) / CLOCKS_PER_SEC << " seconds" << endl;
	if (hasAnswer) {
		res = answer == p3;
	}
	if (!res) {
		cout << "DOESN'T MATCH!!!!" << endl;
		if (hasAnswer) {
			cout << "Desired answer:" << endl;
			cout << "\t" << "\"" << p3 << "\"" << endl;
		}
		cout << "Your answer:" << endl;
		cout << "\t" << "\"" << answer << "\"" << endl;
	} else if (double(endTime - startTime) / CLOCKS_PER_SEC >= 2) {
		cout << "FAIL the timeout" << endl;
		res = false;
	} else if (hasAnswer) {
		cout << "Match :-)" << endl;
	} else {
		cout << "OK, but is it right?" << endl;
	}
	cout << "" << endl;
	return res;
}
int main() {
    PeopleCircle pc;
    int numMales=25,numFemales=25,K=1000;
    string s = pc.order(numMales,numFemales,K);
    cout<<s<<endl;
    return 1;
}
Exemple #3
0
int main() {
    PeopleCircle pc;

    cout << pc.order(5, 3, 2) << endl;
    cout << pc.order(7, 3, 1) << endl;
    cout << pc.order(25, 25, 1000) << endl;
    cout << pc.order(5, 5, 3) << endl;
    cout << pc.order(1, 0, 245) << endl;

    return 0;
}
Exemple #4
0
int main(int argc, char* argv[]){
  if(argc != 4){
    cout << "Wrong number of inputs: "<<argc<<endl;
    return 0;
  }
  int m = stoi(string(argv[1]));
  int f = stoi(string(argv[2]));
  int k = stoi(string(argv[3]));
  PeopleCircle p;
  cout<<"Calling order("<<m<<", "<<f<<", "<<k<<")"<<endl;
  string ret = p.order(m,f,k);
  cout<<"Answer: "<<ret<<endl;

}
Exemple #5
0
    void testCase4() {
		int numMales = 1;
		int numFemales = 0;
		int K = 245;
		string expected_ = "M";
        assertEquals(4, expected_, solution.order(numMales, numFemales, K));
    }
Exemple #6
0
    void testCase3() {
		int numMales = 5;
		int numFemales = 5;
		int K = 3;
		string expected_ = "MFFMMFFMFM";
        assertEquals(3, expected_, solution.order(numMales, numFemales, K));
    }
Exemple #7
0
    void testCase2() {
		int numMales = 25;
		int numFemales = 25;
		int K = 1000;
		string expected_ = "MMMMMFFFFFFMFMFMMMFFMFFFFFFFFFMMMMMMMFFMFMMMFMFMMF";
        assertEquals(2, expected_, solution.order(numMales, numFemales, K));
    }
Exemple #8
0
    void testCase1() {
		int numMales = 7;
		int numFemales = 3;
		int K = 1;
		string expected_ = "FFFMMMMMMM";
        assertEquals(1, expected_, solution.order(numMales, numFemales, K));
    }
bool do_test(int numMales, int numFemales, int K, string __expected) {
    time_t startClock = clock();
    PeopleCircle *instance = new PeopleCircle();
    string __result = instance->order(numMales, numFemales, K);
    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;
    }
}