Mapped Files give very fast access to huge amounts of data

Sometimes you write a program and it requires lots of extra storage. Perhaps it needs to deal with lots of information. If the requirements are large there are several alternatives to consider: 1. use main process memory (HeapAlloc, VirtualAlloc, or any API that eventually calls these, such as C++ new, C# new, etc). a. 32…

0

Blinking Lights are useful

A while ago, computers had blinking lights on a front panel. I recognized various patterns of blinking lights as indicating various operating modes: idle, waiting for teletype input, typing on the teletype machine, reading a paper tape, busy with high CPU usage. This is similar to the technology of the computer that‘s still running on…

3

Create managed Tests for native code

In the old days of code development, the developer would do several steps repeatedly: 1. edit the code 2. Save 3. Compile 4. Link 5. Deploy (if necessary) 6. Start (or switch to) the debugger 7. Start the app under the debugger. 8. Examine the code behavior changes with breakpoints and other debugger windows. This…

0

Scan the Windows Event Log for your application crashes and hangs

When you write software that runs on someone’s machine, it might crash or hang. If this occurs, there are ways to see if this occurred from your program. For example, I wrote a simple application in C++ called CppTest that crashes by dereferencing a null: char *ptr = 0; *ptr = 0; Lo and behold:…

0

Use Custom Attributes to initialize test environments

Some tests can be quite complex, perhaps having prerequisites that consist of various steps, querying initial conditions, loading test data, etc. You can use Attributes to specify various test configurations. The sample below shows how to create your own attribute class and how to retrieve and use it in various parts of your code. I…

0

Create a logger for watching your test progress as it runs.

  I was creating a project that’s a Windows Service, which has components running in multiple processes, using multiple threads and named pipes for communication. To understand the behavior of the code, I wanted to have accurate logging that: · The timing was very critical, so I wanted the log to show the sequence of…

0

Turn your tests into stress tests easily

It’s great to be able to write tests and execute them while developing a project. While I’m developing, I can hit a button and run the dozens of tests to see if I’ve broken anything. As code gets written lots of things get refactored, moved around, etc. Hitting a button to see if I broke…

0

Increase the memory available to your tests

    I love having test projects included in my solutions. Software is alive. I’m constantly making improvements/changes/fixes. When I have customers asking for various features in my code, or for code improvements, being agile and able to publish a changed build with utmost confidence relies largely on a great set of tests that can…

1

Automatic tests protect your code

  Last month  in  Dynamically create huge tooltips in WPF TreeView and ListView I showed some code that creates large tooltips to present lots of data.   Today, we’ll talk about creating automatic tests for this feature.  Testing User Interface features has been difficult historically. How do you automate a mouse hovering over an item?…

0

Dynamically create huge tooltips in WPF TreeView and ListView

  Tooltips are useful. When the mouse hovers over a button a tip can indicate what happens when it’s clicked. The mouse move does not actually invoke the button, but can give information in a passive way.   Sometimes I want to make huge tooltips. This essentially gives more screen real estate for presenting a…

0