コード例 #1
0
        /**
         * Runs SudokuSolver regression tests.
         * @param threadsNumber    Number of threads.
         * @return    Number of tests with errors.
         */
        public static int Start(int threadsNumber)
        {
            int            numberOfTests = GeneratorTests.NUMBER_OF_TESTS;
            int            resultsError  = 0;
            int            resultsOk     = 0;
            long           startTime     = DateTimeX.currentTimeMillis();
            GeneratorTests st            = new GeneratorTests(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 SudokuGenerator 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);
        }
コード例 #2
0
		/**
		 * Runs SudokuSolver regression tests.
		 * @param threadsNumber    Number of threads.
		 * @return    Number of tests with errors.
		 */
		public static int Start(int threadsNumber) {
			int numberOfTests = GeneratorTests.NUMBER_OF_TESTS;
			int resultsError = 0;
			int resultsOk = 0;
			long startTime = DateTimeX.currentTimeMillis();
			GeneratorTests st = new GeneratorTests(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 SudokuGenerator 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;
		}