aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-08-06 16:13:21 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-08-06 16:13:21 +0200
commit1011b0952a55c0102cd81ba95d46b8eaeea4bcf5 (patch)
treedf21525c9d51f3cfd22a6b53d3ef0a703100c904 /ber
parentad9f52bfce0805e757af93190332ed9ccb69269a (diff)
Test exported functions
Diffstat (limited to 'ber')
-rw-r--r--ber/bool.go4
-rw-r--r--ber/bool_test.go4
-rw-r--r--ber/int_test.go6
3 files changed, 7 insertions, 7 deletions
diff --git a/ber/bool.go b/ber/bool.go
index 3bff693..39d2562 100644
--- a/ber/bool.go
+++ b/ber/bool.go
@@ -1,10 +1,10 @@
package ber
-func unmarshalBool(b byte) bool {
+func UnmarshalBool(b byte) bool {
return b != 0x00
}
-func marshalBool(b bool) byte {
+func MarshalBool(b bool) byte {
if b {
return 0xFF
}
diff --git a/ber/bool_test.go b/ber/bool_test.go
index 7471a33..360c3b9 100644
--- a/ber/bool_test.go
+++ b/ber/bool_test.go
@@ -14,11 +14,11 @@ var boolTestData = []boolTest{
func TestBool(t *testing.T) {
for _, test := range boolTestData {
- a := marshalBool(test.in)
+ a := MarshalBool(test.in)
if a != test.out {
t.Error(test.in, "expected", test.out, "got", a)
}
- n := unmarshalBool(test.out)
+ n := UnmarshalBool(test.out)
if n != test.in {
t.Error(test.out, "expected", test.in, "got", n)
}
diff --git a/ber/int_test.go b/ber/int_test.go
index c7f4ee2..ba1e5b0 100644
--- a/ber/int_test.go
+++ b/ber/int_test.go
@@ -6,7 +6,7 @@ import (
)
type intTest struct {
- in int64
+ in int
out []byte
}
@@ -24,11 +24,11 @@ var intTestData = []intTest{
func TestInt(t *testing.T) {
for _, test := range intTestData {
- a := marshalInt(test.in)
+ a := MarshalInt(test.in)
if !bytes.Equal(a, test.out) {
t.Error(test.in, "expected", test.out, "got", a)
}
- n := unmarshalInt(test.out)
+ n := UnmarshalInt(test.out)
if n != test.in {
t.Error(test.out, "expected", test.in, "got", n)
}