Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0d1cdd26
Commit
0d1cdd26
authored
Nov 11, 2014
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update TestNumberToBytes
parent
cff0d931
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
bytes_test.go
ethutil/bytes_test.go
+9
-8
No files found.
ethutil/bytes_test.go
View file @
0d1cdd26
...
...
@@ -28,16 +28,17 @@ func (s *BytesSuite) TestDeleteFromByteSlice(c *checker.C) {
}
}
*/
func
(
s
*
BytesSuite
)
TestNumberToBytes
(
c
*
checker
.
C
)
{
data := int(1)
exp := []byte{0, 0, 0, 0, 0, 0, 0, 1}
// TODO this fails. why?
res := NumberToBytes(data, 16)
if bytes.Compare(res, exp) != 0 {
t.Errorf("Expected % x Got % x", exp, res)
}
// data1 := int(1)
// res1 := NumberToBytes(data1, 16)
// c.Check(res1, checker.Panics)
var
data2
float64
=
3.141592653
exp2
:=
[]
byte
{
0xe9
,
0x38
}
res2
:=
NumberToBytes
(
data2
,
16
)
c
.
Assert
(
res2
,
checker
.
DeepEquals
,
exp2
)
}
*/
func
(
s
*
BytesSuite
)
TestBytesToNumber
(
c
*
checker
.
C
)
{
datasmall
:=
[]
byte
{
0
,
1
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment