/** * Runs SudokuSolver regression tests. * @param threadsNumber Number of threads. * @return Number of tests with errors. */ public static int Start(int threadsNumber) { int numberOfTests = SolverTests.NUMBER_OF_TESTS; int resultsError = 0; int resultsOk = 0; long startTime = DateTimeX.currentTimeMillis(); SolverTests st = new SolverTests(threadsNumber); st.start(); bool[] testResults = st.testsResults; for (int t = 0; t < numberOfTests; t++) { if (testResults[t] == true) { resultsOk++; } else { resultsError++; } } long endtTime = DateTimeX.currentTimeMillis(); double computingTime = (endtTime - startTime) / 1000.0; SudokuStore.consolePrintln("============================================================="); SudokuStore.consolePrintln("Number of SudokuSolver test: " + numberOfTests + ", OK: " + resultsOk + ", ERRORS: " + resultsError + ", computing time: " + computingTime); for (int t = 0; t < numberOfTests; t++) { if (testResults[t] == false) { SudokuStore.consolePrintln("ERROR: " + t); } } SudokuStore.consolePrintln("============================================================="); return(resultsError); }
/** * Runs SudokuSolver regression tests. * @param threadsNumber Number of threads. * @return Number of tests with errors. */ public static int Start(int threadsNumber) { int numberOfTests = SolverTests.NUMBER_OF_TESTS; int resultsError = 0; int resultsOk = 0; long startTime = DateTimeX.currentTimeMillis(); SolverTests st = new SolverTests(threadsNumber); st.start(); bool[] testResults = st.testsResults; for (int t = 0; t < numberOfTests; t++) { if (testResults[t] == true) resultsOk++; else resultsError++; } long endtTime = DateTimeX.currentTimeMillis(); double computingTime = (endtTime - startTime)/1000.0; SudokuStore.consolePrintln("============================================================="); SudokuStore.consolePrintln("Number of SudokuSolver test: " + numberOfTests + ", OK: " + resultsOk + ", ERRORS: " + resultsError + ", computing time: " + computingTime); for (int t = 0; t < numberOfTests; t++) if (testResults[t] == false) SudokuStore.consolePrintln("ERROR: " + t); SudokuStore.consolePrintln("============================================================="); return resultsError; }