예제 #1
0
void loop() {
  string common;
  content *data;
  string choice;
  
  while (true) {
    fflush(stdin);
    cin >> common;
    if (common == "quit" || common == "Quit"
	|| common == "QUIT") return;
    data = trees->get(common);
    if (data != NULL) {
      cout << "Latin name: " << data->name << endl;
      cout << "Description: " << endl;
      choice = "";
      if ( data->loc != 0 ) printdesc(data->loc);
      else cout << "No description is available." << endl;
      cout << "Delete this record? (Y/N) ";
      cin >> choice;
      if ( choice == "Y" || choice == "y" ) {
	if (deleterec(common) == 1) { 
	  numTrees--;
	  cout << "Record deleted, " << numTrees << " records total." << endl; 
	}
	else cout << "Could not delete record, " << numTrees << " records total." << endl;
      }
    }
    else {
      if (common == "add" || common == "Add"
void GAnalogSensor::print(Print& prn, const __FlashStringHelper* desc, const __FlashStringHelper* unit, const __FlashStringHelper* ad)
{
	if(desc) prn.print(desc); else printdesc(prn);
	prn.print(get(), 3);
	if(!unit && !ad) prn.print(F("V\n\r"));
	if(unit) prn.print(unit); 
	if(ad) {
		prn.print(getAD(), 1);
		prn.print(ad);
	}
}
예제 #3
0
파일: palette.c 프로젝트: Nekrofage/DoomRPi
int main(int argc, char * const argv[])
{
	parseopts(argc, argv);
	printdesc("Regression testsuite palette handling\n\n");

	testcase1("Draw green box");

	printsummary();

	return 0;
}
예제 #4
0
파일: lock.c 프로젝트: Nekrofage/DoomRPi
int main(int argc, char * const argv[])
{
	parseopts(argc, argv);

	printdesc("Regression testsuite for ggLock(3) & friends.\n\n");

	testcase1("Checks behaviour of locking functions, whether they match documentation.");

	printsummary();

	return 0;
}
예제 #5
0
파일: init.c 프로젝트: Nekrofage/DoomRPi
int main(int argc, char * const argv[])
{
	parseopts(argc, argv);

	printdesc("Regression testsuite for libgg init/exit handling\n\n");

	testcase1("Check that ggInit() behaves as documented.");
	testcase2("Check that ggExit() behaves as documented.");


	printsummary();

	return 0;
}
예제 #6
0
파일: mansync.inc.c 프로젝트: antrik/libggi
int main(int argc, char * const argv[])
{
	int rc;

	parseopts(argc, argv);
	printdesc("Regression testsuite for display-x(7).\n\n");

	rc = ggiInit();
	if (rc < 0) ggPanic("Couldn't initialize libggi");

	testcase1("See, if mansync actually runs in SYNC mode - sets up the mode the same way as XGGI does");

	printsummary();

	return 0;
}
예제 #7
0
파일: mode.c 프로젝트: Nekrofage/DoomRPi
int main(int argc, char * const argv[])
{
	parseopts(argc, argv);
	printdesc("Regression testsuite mode handling\n\n");

	testcase1("Check that ggiCheckMode() doesn't return GGI_AUTO");
	testcase2("Check that ggiSetMode() can actually set the mode that has been suggested by ggiCheckMode");
	testcase3("Check setting a mode with a given number of frames");
	testcase4("Check setting a mode by its physical size");
	testcase5("Set up the mode in the ggiterm way");
	testcase6("Check that re-setting of a different mode works [async mode]");
	testcase7("Check that re-setting of a different mode works [sync mode]");
	testcase8("Check checking then setting a mode with braindamaged visual size");
	testcase9("Check modelist");

	printsummary();

	return 0;
}
예제 #8
0
int main(int argc, char *argv[])
{
	parseopts(argc, argv);

	printdesc("Regression testsuite for libgg's internal ggParseTarget() function.\n\n");

	testcase1("Passes a string with whitespaces only. Expected to return \\0.");
	testcase2("Passes a string with an too short target buffer. "
		"This expects to fill up the buffer as much as possible, "
		"but not completely - buffer overflow protection.");
	testcase3("Passes a string with valid arguments.");
	testcase4("Passes a string with syntax error: "
		"A closing bracket doesn\'t match an opening bracket.");
	testcase5("Passes a string with syntax error: "
		"Number of opening and closing brackets matches, but wrong ordered.");

	printsummary();

	return 0;
}