Ejemplo n.º 1
0
QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) const
{
    static const Core::Id id
            = Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(QtTest::Constants::FRAMEWORK_NAME);

    QStringList arguments;
    if (AutotestPlugin::settings()->processArgs) {
        arguments.append(QTestUtils::filterInterfering(
                             runnable().commandLineArguments.split(' ', QString::SkipEmptyParts),
                             omitted, false));
    }
    TestFrameworkManager *manager = TestFrameworkManager::instance();
    auto qtSettings = qSharedPointerCast<QtTestSettings>(manager->settingsForTestFramework(id));
    if (qtSettings.isNull())
        return arguments;
    if (qtSettings->useXMLOutput)
        arguments << "-xml";
    if (testCases().count())
        arguments << testCases();

    const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
    if (!metricsOption.isEmpty())
        arguments << metricsOption;

    if (qtSettings->verboseBench)
        arguments << "-vb";

    if (qtSettings->logSignalsSlots)
        arguments << "-vs";

    if (isDebugRunMode() && qtSettings->noCrashHandler)
        arguments << "-nocrashhandler";

    return arguments;
}
Ejemplo n.º 2
0
int main(int argc, char* argv[]){
 if(argc<=1){
  printf("Input file pathname missing.\n\n");
  return 0;
 }else{
 
  FILE *ptr_output; 
  FILE *ptr_input;
  char buff[1000];
  
  ptr_input = fopen(argv[1],"r");
  ptr_output = fopen("output","w");
  if (!ptr_input){
   printf("Could not read file: %s \n\n",argv[1]);
  }else if(!ptr_output){
   printf("Could not open file: output \n\n");
  }else{
   printf("Reading file: %s ... \n",argv[1]);

   testCases(ptr_input,ptr_output);
  }
  fclose(ptr_input);
  fclose(ptr_output);
  printf("Done.\n");
 }
 return 0;
}
void main() {
	char * P = (char *)malloc(sizeof(char) * 100);
	int index = 0;
	char digit;
	printf("Enter the P: \n");
	while ((digit = getchar()) == '0');

	if (digit != '\n') {
		P[index++] = digit;
		while ((digit = getchar()) != '\n') {
			P[index] = digit;
			index++;
		}
		P[index] = '\0';
		if (isValidInput(P)) {
			int K;
			printf("Enter K: ");
			scanf("%d", &K);
			char Q[10000] = "";
			while (K > 0) {
				formQ(Q, P);
				K--;
			}
			Q[length(Q)] = '\0';
			printf("The number %s ", Q);
			testCases(P, index);
		}
		else
			printf("The given number is not a valid number .\n");
	}
	else
		printf("0 is divisible by 3.\n");
	_getch();
	return 0;
}
int main() {
    int cases, n;
    testCases();
    scanf("%d", &cases);
    while (cases--) {
        scanf("%d", &n);
        printf("%d\n", largestPalindrome(n));
    }
    return 0;
}
Ejemplo n.º 5
0
int main (int argc, char const *argv[]) {

	int i = 0;
	// A loop for testing. Don't need hard coding. 
	while (i < 100) {
	
	    i ++;
	    int ranNumber1 = rand(), ranNumber2 = rand();

	    assert (testCases(ranNumber1, ranNumber2));
	    printf ("pass\n");
	}
	int first, second;
	getInput (&first, &second);
	swap (&first, &second);
	printf ("%d, %d \n", first, second);
	return 0;
}