forked from mirror/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
419 B
25 lines
419 B
8 years ago
|
package vm
|
||
|
|
||
|
import (
|
||
|
"math"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestMemoryGasCost(t *testing.T) {
|
||
|
size := uint64(math.MaxUint64 - 64)
|
||
|
_, err := memoryGasCost(&Memory{}, size)
|
||
|
if err != nil {
|
||
|
t.Error("didn't expect error:", err)
|
||
|
}
|
||
|
|
||
|
_, err = memoryGasCost(&Memory{}, size+32)
|
||
|
if err != nil {
|
||
|
t.Error("didn't expect error:", err)
|
||
|
}
|
||
|
|
||
|
_, err = memoryGasCost(&Memory{}, size+33)
|
||
|
if err == nil {
|
||
|
t.Error("expected error")
|
||
|
}
|
||
|
}
|