tmauldin / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Unhandled Exception when running tests (InvalidOperationException at Gallio.Icarus.TestResults.TestStepComparer.Compare) #782

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a large number of tests
2. While the test are running, sort the Test Results view by Duration
3.

What is the expected output? What do you see instead?
Actual:
System.InvalidOperationException: Failed to compare two elements in the array. 
---> System.NullReferenceException: Object reference not set to an instance of 
an object.
   at Gallio.Icarus.TestResults.TestStepComparer.Compare(ListViewItem x, ListViewItem y)
   at System.Collections.Generic.ArraySortHelper`1.SwapIfGreaterWithItems(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
   at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
   at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Reported by: 
UnhandledExceptionPolicy
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.Control.WmNotify(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Gallio.UI.ErrorReporting.ErrorDialogUnhandledExceptionHandler.RunApplicationWithHandler(Form mainForm)
   at Gallio.Icarus.IcarusProgram.RunImpl(String[] args)
   at Gallio.Runtime.ConsoleSupport.ConsoleProgram`1.Run(IRichConsole console, String[] args) in c:\Server\Projects\MbUnit v3.3\Work\src\Gallio\Gallio\Runtime\ConsoleSupport\ConsoleProgram.cs:line 198
   at Gallio.Icarus.IcarusProgram.Main(String[] args)

What version of the product are you using? On what operating system?
3.3.134.0 on Windows 7 x64

Please provide any additional information below.

Original issue reported on code.google.com by wayne.br...@gmail.com on 30 Nov 2010 at 4:40

GoogleCodeExporter commented 9 years ago
Interesting. That code is a nightmare, thanks to the VLV and asynchrony fun & 
games. Even the "empty" list view item shouldn't cause a NRE though.

Original comment by grahamr...@gmail.com on 26 Feb 2011 at 1:46

GoogleCodeExporter commented 9 years ago
Added null guards to Compare

Original comment by grahamr...@gmail.com on 28 Sep 2011 at 8:31

GoogleCodeExporter commented 9 years ago

Original comment by Yann.Tre...@gmail.com on 29 Sep 2011 at 5:41