C# (Windows)
I present to you, the brand new Memtest86 Simulator 2014! (Because running Memtest86 under Windows makes total sense)
Complete with working progress bars and pattern indicator!
This code extensively uses the Console class, which as far as I know, it's only available on Windows. Also, I couldn't find a way to show the real processor name/frequency and available memory, so those are hardcoded.
Screenshot:
Code (ugly, I know):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
class MemTestSim
{
static void Main(string[] args)
{
Random r = new Random();
int seconds = 0;
int pass = 0;
int test = 0;
int testNumber = 0;
string[] testNames = { "Address test, own Adress", "Moving inversions, ones & zeros", "Moving inversions, 8 bit pattern" };
string[] pattern = { "80808080", "7f7f7f7f", "40404040", "bfbfbfbf", "20202020", "dfdfdfdf", "10101010", "efefefef", "08080808", "f7f7f7f7", "8f8f8f8f" };
// Trick to stop the console from scrolling
Console.SetWindowSize(80, 40);
Console.Title = "Memtest86+ v2.11";
Console.CursorVisible = false;
// Dark Blue Background Color
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.Clear();
// Green Title Text
Console.BackgroundColor = ConsoleColor.DarkGreen;
Console.ForegroundColor = ConsoleColor.Black;
Console.Write(" Memtest86+ v2.11 ");
// Gray on Blue Text and main window structure
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.ForegroundColor = ConsoleColor.Gray;
Console.Write("| Pass " + pass + "%\n");
Console.WriteLine("Intel Core i5 2290 MHz | Test ");
Console.WriteLine("L1 Cache: 128K 1058MB/s | Test #" + testNumber + " [" + testNames[0] + "]");
Console.WriteLine("L2 Cache: 512K 1112MB/s | Testing: 132K - 8192M 8192M");
Console.WriteLine("L3 Cache: 3072K 1034MB/s | Pattern: ");
Console.WriteLine("Memory : 8192M |---------------------------------------------------");
Console.WriteLine("Chipset : Intel i440FX");
Console.WriteLine();
Console.WriteLine();
Console.WriteLine(" WallTime Cached RsvdMem MemMap Cache ECC Test Pass Errors ECC Errs");
Console.WriteLine(" --------- ------ ------- -------- ----- --- ---- ---- ------ --------");
Console.WriteLine(" 0:00:26 8192M 64K e820-Std on off Std 0 0");
// Bottom Bar
Console.SetCursorPosition(0, 24);
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("(ESC)Reboot (c)configuration (SP)scroll_lock (CR)scroll_unlock ");
Console.SetWindowSize(80, 25);
// Reset text color
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.ForegroundColor = ConsoleColor.Gray;
// FOREVER
while (true)
{
TimeSpan time = TimeSpan.FromSeconds(seconds);
// Running Time (WallTime)
Console.SetCursorPosition(3, 11);
string min = (time.Minutes < 10 ? "0" + time.Minutes : "" + time.Minutes);
string sec = (time.Seconds < 10 ? "0" + time.Seconds : "" + time.Seconds);
Console.Write(time.Hours + ":" + min + ":" + sec);
// Test percentage
Console.SetCursorPosition(34, 1);
Console.Write((int)test + "%");
// Test Progress Bar
Console.SetCursorPosition(38, 1);
for (int i = 0; i < test / 3; i++)
Console.Write("#");
Console.SetCursorPosition(38, 0);
for (int i = 0; i < pass / 3; i++)
Console.Write("#");
// Test Number
Console.SetCursorPosition(35, 2);
Console.Write(testNumber + " [" + testNames[testNumber] + "] ");
if (testNumber != 0)
{
Console.SetCursorPosition(38, 4);
Console.Write(pattern[test / 10]);
}
else
{
Console.SetCursorPosition(38, 4);
Console.Write(" ");
}
if (test >= 100)
{
test = 0;
Console.SetCursorPosition(34, 0);
Console.Write(pass + "%");
Console.SetCursorPosition(34, 1);
Console.Write(" ");
testNumber++;
pass += 2;
if (testNumber == 2)
testNumber = 0;
}
Thread.Sleep(1000);
test += r.Next(0, 3);
seconds++;
}
}
}