mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-13 11:35:52 +01:00
Merge abab648f39
into c7191d2913
This commit is contained in:
commit
4edfc511b3
1 changed files with 17 additions and 0 deletions
|
@ -960,3 +960,20 @@ func TestInitConsistentState(t *testing.T) {
|
|||
blocks[len(blocks)-1].Height())
|
||||
}
|
||||
}
|
||||
|
||||
func TestTotalMemoryUsage(t *testing.T) {
|
||||
// Mocked utxoCache instance
|
||||
s := newUtxoCache(nil, 1*1024*1024)
|
||||
|
||||
// Call the totalMemoryUsage method
|
||||
result := s.totalMemoryUsage()
|
||||
|
||||
expectedSize := uint64(1 * 1024 * 1024)
|
||||
|
||||
resultShoulBeTrue := result == expectedSize
|
||||
|
||||
// Compare the expected result with the actual result
|
||||
if resultShoulBeTrue {
|
||||
t.Errorf("Expected memory usage %d, got %d", expectedSize, result)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue