This commit is contained in:
web3santa 2025-03-10 08:44:25 -04:00 committed by GitHub
commit 4edfc511b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}
}