(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func TestUint256(t *testing.T) { |
| 30 | Convey("uint256 len", t, func() { |
| 31 | i := Uint256{} |
| 32 | So(unsafe.Sizeof(Uint256{}), ShouldEqual, 32) |
| 33 | So(len(i.Bytes()), ShouldEqual, 32) |
| 34 | }) |
| 35 | Convey("convert", t, func() { |
| 36 | i := Uint256{math.MaxUint64, 3, 444, 1230} |
| 37 | log.Print(i.Bytes()) |
| 38 | j, err := Uint256FromBytes(i.Bytes()) |
| 39 | |
| 40 | So(err, ShouldBeNil) |
| 41 | So(j.A == math.MaxUint64, ShouldBeTrue) |
| 42 | So(j.B, ShouldEqual, 3) |
| 43 | So(j.C, ShouldEqual, 444) |
| 44 | So(j.D, ShouldEqual, 1230) |
| 45 | }) |
| 46 | Convey("convert error", t, func() { |
| 47 | i, err := Uint256FromBytes([]byte("aaa")) |
| 48 | So(err, ShouldEqual, ErrBytesLen) |
| 49 | So(i, ShouldBeNil) |
| 50 | }) |
| 51 | } |
| 52 | |
| 53 | func TestUint256_Inc(t *testing.T) { |
| 54 | Convey("uint256 inc", t, func() { |
nothing calls this directly
no test coverage detected