@@ -292,7 +292,7 @@ class LogTest : BaseDbTest() {
292292
293293 val rex = Regex (" cbl_(debug|verbose|info|warning|error)_\\ d+\\ .cbllog" )
294294 for (file in files) {
295- Assert .assertTrue(file.name.matches(rex))
295+ Assert .assertTrue(file.name.matches(rex) || file.name.contains( " crash " ) )
296296 }
297297 }
298298 }
@@ -347,8 +347,9 @@ class LogTest : BaseDbTest() {
347347 ) {
348348 // This should create two files for each of the 5 levels except verbose (debug, info, warning, error):
349349 // 1k of logs plus .5k headers. There should be only one file at the verbose level (just the headers)
350+ // and the crash log file
350351 write1KBToLog()
351- Assert .assertEquals((4 * 2 ) + 1 , logFiles.size)
352+ Assert .assertEquals((4 * 2 ) + 2 , logFiles.size)
352353 }
353354 }
354355
@@ -364,11 +365,11 @@ class LogTest : BaseDbTest() {
364365 ) {
365366 // This should create several files for each of the 5 levels except verbose (debug, info, warning, error):
366367 // 1k of logs plus .5k headers. Although lots of files are created they should be trimmed to only 3
367- // at each level. There should be only one file at the verbose level (just the headers)
368+ // at each level. There should be only one file at the verbose level (just the headers) and the crash log file
368369 repeat(21 ) {
369370 write1KBToLog()
370371 }
371- Assert .assertEquals((4 * 3 ) + 1 , logFiles.size)
372+ Assert .assertEquals((4 * 3 ) + 2 , logFiles.size)
372373 }
373374 }
374375
@@ -403,6 +404,10 @@ class LogTest : BaseDbTest() {
403404 Assert .assertNotNull(tempDir!! .listFiles())
404405 for (log in logFiles!! ) {
405406 val fn = log.name.lowercase(Locale .getDefault())
407+ if (fn.contains(" crash" )) {
408+ continue ;
409+ }
410+
406411 if (fn.startsWith(" cbl_debug_" ) || fn.startsWith(" cbl_verbose_" )) {
407412 Assert .assertFalse(getLogContents(log).contains(uuidString))
408413 } else {
@@ -420,6 +425,10 @@ class LogTest : BaseDbTest() {
420425 ) {
421426 write1KBToLog()
422427 for (log in logFiles) {
428+ if (log.name.contains(" crash" )) {
429+ continue ;
430+ }
431+
423432 var logLine: String
424433 BufferedReader (FileReader (log)).use {
425434 logLine = it.readLine()
@@ -477,7 +486,7 @@ class LogTest : BaseDbTest() {
477486 Log .e(LogDomain .DATABASE , message, error)
478487
479488 for (log in logFiles) {
480- if (! log.name.contains(" verbose" )) {
489+ if (! log.name.contains(" verbose" ) && ! log.name.contains( " crash " ) ) {
481490 Assert .assertTrue(getLogContents(log).contains(uuid))
482491 }
483492 }
@@ -498,7 +507,7 @@ class LogTest : BaseDbTest() {
498507 Log .e(LogDomain .DATABASE , message, error, uuid2)
499508
500509 for (log in logFiles) {
501- if (! log.name.contains(" verbose" )) {
510+ if (! log.name.contains(" verbose" ) && ! log.name.contains( " crash " ) ) {
502511 val content = getLogContents(log)
503512 Assert .assertTrue(content.contains(uuid1))
504513 Assert .assertTrue(content.contains(uuid2))
0 commit comments