Skip to content

Commit

Permalink
More testing
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed Mar 13, 2017
1 parent ad93d99 commit 191c10c
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,41 @@ public void teardownPagedFile() throws IOException
pagedFile.close();
}

@Test
public void shouldNotCrashOnEmptyFile() throws Exception
{
// GIVEN
Page[] pages = with();
initializeFile( pagedFile, pages );

// WHEN
SimpleMonitor monitor = new SimpleMonitor();
crashGenCleaner( pagedFile, 0, pages.length, monitor ).clean();

// THEN
assertPagesVisisted( monitor, pages.length );
assertCleanedCrashPointers( monitor, 0 );
}

@Test
public void shouldNotReportErrorsOnCleanPages() throws Exception
{
// GIVEN
Page[] pages = with(
leafWith(),
internalWith()
);
initializeFile( pagedFile, pages );

// WHEN
SimpleMonitor monitor = new SimpleMonitor();
crashGenCleaner( pagedFile, 0, pages.length, monitor ).clean();

// THEN
assertPagesVisisted( monitor, 2 );
assertCleanedCrashPointers( monitor, 0 );
}

@Test
public void shouldCleanOneCrashPerPage() throws Exception
{
Expand Down

0 comments on commit 191c10c

Please sign in to comment.