MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / TestDB_Repair

Function TestDB_Repair

driver/hybriddb/db_test.go:370–395  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368}
369
370func TestDB_Repair(t *testing.T) {
371 tempDir := t.TempDir()
372 cfg := &config.Config{
373 LevelDB: config.LevelDBConfig{
374 CacheSize: 64 * 1024 * 1024,
375 BlockSize: 4 * 1024,
376 WriteBufferSize: 4 * 1024 * 1024,
377 MaxOpenFiles: 1000,
378 Compression: true,
379 },
380 }
381
382 // Create and close a database first
383 db, err := Store{}.Open(tempDir, cfg)
384 require.NoError(t, err)
385
386 key := []byte("repair-key")
387 value := []byte("repair-value")
388 err = db.Put(key, value)
389 require.NoError(t, err)
390 db.Close()
391
392 // Test repair
393 err = Store{}.Repair(tempDir, cfg)
394 require.NoError(t, err)
395}
396
397func TestDB_EdgeCases(t *testing.T) {
398 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.65
OpenMethod · 0.45
PutMethod · 0.45
RepairMethod · 0.45

Tested by

no test coverage detected