Skip to content

Commit

Permalink
AutoColumnize throws an Exception with multiple files if no bookmarks…
Browse files Browse the repository at this point in the history
… are found zarunbal#102
  • Loading branch information
miltob committed Jul 24, 2019
1 parent 720f003 commit 110eedf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/LogExpert.Tests/LogExpert.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
<Project>{003535ec-4186-4958-9dd9-c641f089aeed}</Project>
<Name>JsonCompactColumnizer</Name>
</ProjectReference>
<ProjectReference Include="..\Log4jXmlColumnizer\Log4jXmlColumnizer.csproj">
<Project>{c41a517b-7502-4b17-9119-55d5716fad65}</Project>
<Name>Log4jXmlColumnizer</Name>
</ProjectReference>
<ProjectReference Include="..\LogExpert\LogExpert.csproj">
<Project>{f0c0d370-f416-44ed-939a-b4827d15ac14}</Project>
<Name>LogExpert</Name>
Expand Down
12 changes: 12 additions & 0 deletions src/LogExpert.Tests/LogWindowTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,17 @@ public void Instantiate_JsonFile_BuildCorrectColumnizer(string fileName, Type co

Assert.AreEqual(columnizerType, logWindow.CurrentColumnizer.GetType());
}

[TestCase(@".\TestData\XmlTest_01.xml")]
public void Instantiate_AnyFile_NotCrash(string fileName)
{
PluginRegistry.GetInstance().RegisteredColumnizers.Add(new Log4jXmlColumnizer());

LogTabWindow logTabWindow = new LogTabWindow(null, 0, false);
LogWindow logWindow =
new LogWindow(logTabWindow, fileName, false, false);

Assert.True(true);
}
}
}
6 changes: 6 additions & 0 deletions src/LogExpert.Tests/TestData/XmlTest_01.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
4 changes: 4 additions & 0 deletions src/LogExpert/Controls/LogWindow/LogWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public LogWindow(LogTabWindow parent, string fileName, bool isTempFile,

Closing += LogWindow_Closing;
Disposed += LogWindow_Disposed;
Load += LogWindow_Load;

timeSpreadCalc = new TimeSpreadCalculator(this);
timeSpreadingControl1.TimeSpreadCalc = timeSpreadCalc;
Expand Down Expand Up @@ -244,7 +245,10 @@ public LogWindow(LogTabWindow parent, string fileName, bool isTempFile,

statusLineTrigger.Signal += statusLineTrigger_Signal;
selectionChangedTrigger.Signal += selectionChangedTrigger_Signal;
}

private void LogWindow_Load(object sender, EventArgs e)
{
PreferencesChanged(parentLogTabWin.Preferences, true, SettingsFlags.GuiOrColors);
}

Expand Down

0 comments on commit 110eedf

Please sign in to comment.