Exemplo n.º 1
0
        private void StartMemTests()
        {
            CloseAllMemTests();

            var threads  = (int)cboThreads.SelectedItem;
            var ram      = Convert.ToDouble(txtRAM.Text) / threads;
            var startMin = chkStartMin.IsChecked.Value;

            Parallel.For(0, threads, i =>
            {
                memtests[i] = new MemTest();
                memtests[i].Start(ram, startMin);
            });

            /*
             * Some nag message boxes won't be clicked due to concurrent execution.
             * memTestA             | memTestB
             * SetActiveWindow()    |
             *                      | SetActiveWindow()
             * SendNotifyMessage()  |
             *                      | SendNotifyMessage()
             *
             * memTestB's window will be active while calling SendNotifyMessage()
             * for memTestA.
             */
            foreach (var hwnd in WinAPI.FindAllWindows(MemTest.MSG2))
            {
                WinAPI.ControlClick(hwnd, MemTest.MSGBOX_OK);
            }

            if (!chkStartMin.IsChecked.Value)
            {
                LayOutMemTests();
            }
        }
Exemplo n.º 2
0
        private bool StartMemTests()
        {
            CloseAllMemTests();

            var threads  = (int)cboThreads.SelectedItem;
            var ram      = Convert.ToDouble(txtRAM.Text) / threads;
            var startMin = chkStartMin.IsChecked.Value;

            MemTest.VerboseLogging = chkVerbose.IsChecked.Value;
            MemTest.Timeout        = TimeSpan.FromSeconds(udTimeout.Value.Value);
            Parallel.For(0, threads, i =>
            {
                memtests[i] = new MemTest();
                memtests[i].Start(ram, startMin);
            });

            for (int i = 0; i < threads; i++)
            {
                var mt = memtests[i];
                if (!mt.Started)
                {
                    return(false);
                }
            }

            if (!chkStartMin.IsChecked.Value)
            {
                LayoutMemTests();
            }

            return(true);
        }
Exemplo n.º 3
0
        private void StartMemTests()
        {
            CloseAllMemTests();

            var threads  = (int)cboThreads.SelectedItem;
            var ram      = Convert.ToDouble(txtRAM.Text) / threads;
            var startMin = chkStartMin.IsChecked.Value;

            Parallel.For(0, threads, i =>
            {
                memtests[i] = new MemTest();
                memtests[i].Start(ram, startMin);
            });

            if (!chkStartMin.IsChecked.Value)
            {
                LayOutMemTests();
            }
        }
Exemplo n.º 4
0
        private void StartMemTests()
        {
            CloseAllMemTests();

            var threads  = (int)cboThreads.SelectedItem;
            var ram      = Convert.ToDouble(txtRAM.Text) / threads;
            var startMin = chkStartMin.IsChecked.Value;

            Parallel.For(0, threads, i =>
            {
                memtests[i] = new MemTest();
                memtests[i].Start(ram, startMin);
            });

            foreach (var hwnd in WinAPI.FindAllWindows(MemTest.MSG2))
            {
                WinAPI.ControlClick(hwnd, MemTest.MSGBOX_OK);
            }

            if (!chkStartMin.IsChecked.Value)
            {
                LayOutMemTests();
            }
        }