@@ -118,14 +118,13 @@ public void TestIndexListItems(ITestSettings settings)
118118
119119 this . Comment ( "Verifying IndexListItems natvis" ) ;
120120 var arr = currentFrame . GetVariable ( "arr" ) ;
121- Assert . Equal ( "{ size=15 }" , arr . Value ) ;
121+ Assert . Equal ( "{ size=52 }" , arr . Value ) ;
122122
123123 // Index element for IndexListItems
124124 // Natvis retrieves items in reverse order.
125- Assert . Equal ( "196" , arr . GetVariable ( "[0]" ) . Value ) ;
126- Assert . Equal ( "16" , arr . GetVariable ( "[10]" ) . Value ) ;
127- Assert . Equal ( "0" , arr . GetVariable ( "[14]" ) . Value ) ;
128- // TODO: Add test below when we can support the [More..] expansion to handle >50 elements
125+ Assert . Equal ( "2601" , arr . GetVariable ( "[0]" ) . Value ) ;
126+ Assert . Equal ( "1681" , arr . GetVariable ( "[10]" ) . Value ) ;
127+ Assert . Equal ( "0" , arr . GetVariable ( "[More...]" ) . GetVariable ( "[51]" ) . Value ) ;
129128 }
130129
131130 runner . Expects . ExitedEvent ( exitCode : 0 ) . TerminatedEvent ( ) . AfterContinue ( ) ;
@@ -168,14 +167,14 @@ public void TestArrayItems(ITestSettings settings)
168167
169168 this . Comment ( "Verifying ArrayItems natvis" ) ;
170169 var ll = currentFrame . GetVariable ( "vec" ) ;
171- Assert . Equal ( "{ size=10 }" , ll . Value ) ;
170+ Assert . Equal ( "{ size=52 }" , ll . Value ) ;
172171
173172 // Custom Item in natvis
174- Assert . Equal ( "10 " , ll . GetVariable ( "Size" ) . Value ) ;
173+ Assert . Equal ( "52 " , ll . GetVariable ( "Size" ) . Value ) ;
175174
176175 // Index element for ArrayItems
177176 Assert . Equal ( "20" , ll . GetVariable ( "[5]" ) . Value ) ;
178- // TODO: Add test below when we can support the [More..] expansion to handle >50 elements
177+ Assert . Equal ( "0" , ll . GetVariable ( " [More...]" ) . GetVariable ( "[51]" ) . Value ) ;
179178 }
180179
181180 runner . Expects . ExitedEvent ( exitCode : 0 ) . TerminatedEvent ( ) . AfterContinue ( ) ;
@@ -220,8 +219,7 @@ public void TestLinkedListItems(ITestSettings settings)
220219
221220 // Index element for LinkedListItems
222221 Assert . Equal ( "5" , ll . GetVariable ( "[5]" ) . Value ) ;
223- // TODO: Uncomment line below when we can support the [More..] expansion to handle >50 elements
224- // Assert.Equal("75", ll.GetVariable("[More...]").GetVariable("[75]").Value);
222+ Assert . Equal ( "75" , ll . GetVariable ( "[More...]" ) . GetVariable ( "[75]" ) . Value ) ;
225223 }
226224
227225 runner . Expects . ExitedEvent ( exitCode : 0 ) . TerminatedEvent ( ) . AfterContinue ( ) ;
@@ -330,6 +328,45 @@ public void TestThisConditional(ITestSettings settings)
330328 }
331329 }
332330
331+ [ Theory ]
332+ [ DependsOnTest ( nameof ( CompileNatvisDebuggee ) ) ]
333+ [ RequiresTestSettings ]
334+ // Disable on macOS
335+ [ UnsupportedDebugger ( SupportedDebugger . Lldb , SupportedArchitecture . x64 | SupportedArchitecture . x86 ) ]
336+ public void TestArrayPointer ( ITestSettings settings )
337+ {
338+ this . TestPurpose ( "This test checks if the comma format specifier is visualized." ) ;
339+ this . WriteSettings ( settings ) ;
340+
341+ IDebuggee debuggee = Debuggee . Open ( this , settings . CompilerSettings , NatvisName , DebuggeeMonikers . Natvis . Default ) ;
342+
343+ this . Comment ( "Run the debuggee, check argument count" ) ;
344+ using ( IDebuggerRunner runner = CreateDebugAdapterRunner ( settings ) )
345+ {
346+ this . Comment ( "Configure launch" ) ;
347+ LaunchCommand launch = new LaunchCommand ( settings . DebuggerSettings , debuggee . OutputPath ) ;
348+ runner . RunCommand ( launch ) ;
349+
350+ this . Comment ( "Set Breakpoint" ) ;
351+ SourceBreakpoints writerBreakpoints = debuggee . Breakpoints ( NatvisSourceName , ReturnSourceLine ) ;
352+ runner . SetBreakpoints ( writerBreakpoints ) ;
353+
354+ runner . Expects . StoppedEvent ( StoppedReason . Breakpoint ) . AfterConfigurationDone ( ) ;
355+
356+ using ( IThreadInspector threadInspector = runner . GetThreadInspector ( ) )
357+ {
358+ IFrameInspector currentFrame = threadInspector . Stack . First ( ) ;
359+
360+ this . Comment ( "Verifying comma format specifier" ) ;
361+ int [ ] expected = { 0 , 1 , 4 , 9 } ;
362+ currentFrame . AssertEvaluateAsIntArray ( "arr._array,4" , EvaluateContext . Watch , expected ) ;
363+ }
364+
365+ runner . Expects . ExitedEvent ( exitCode : 0 ) . TerminatedEvent ( ) . AfterContinue ( ) ;
366+ runner . DisconnectAndVerify ( ) ;
367+ }
368+ }
369+
333370 #endregion
334371 }
335372}
0 commit comments