mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 23:58:17 +01:00
Added copyright header and more test cases for key encoder/decoder.
This commit is contained in:
parent
37eb407572
commit
c84feab792
@ -1,3 +1,7 @@
|
|||||||
|
// Copyright 2014 by Sascha L. Teichmann
|
||||||
|
// Use of this source code is governed by the MIT license
|
||||||
|
// that can be found in the LICENSE file.
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
@ -45,18 +49,32 @@ func checkEncodeDecode(
|
|||||||
func TestEncodeDecode(t *testing.T) {
|
func TestEncodeDecode(t *testing.T) {
|
||||||
allData(func(c Coord) {
|
allData(func(c Coord) {
|
||||||
checkEncodeDecode(
|
checkEncodeDecode(
|
||||||
"Big endian",
|
"Big endian - interleaved",
|
||||||
CoordToInterleaved,
|
CoordToInterleaved,
|
||||||
EncodeToBigEndian, DecodeFromBigEndian,
|
EncodeToBigEndian, DecodeFromBigEndian,
|
||||||
c, t)
|
c, t)
|
||||||
})
|
})
|
||||||
allData(func(c Coord) {
|
allData(func(c Coord) {
|
||||||
checkEncodeDecode(
|
checkEncodeDecode(
|
||||||
"String",
|
"String - interleaved",
|
||||||
CoordToInterleaved,
|
CoordToInterleaved,
|
||||||
EncodeStringToBytes, DecodeStringFromBytes,
|
EncodeStringToBytes, DecodeStringFromBytes,
|
||||||
c, t)
|
c, t)
|
||||||
})
|
})
|
||||||
|
allData(func(c Coord) {
|
||||||
|
checkEncodeDecode(
|
||||||
|
"Big endian - plain",
|
||||||
|
CoordToPlain,
|
||||||
|
EncodeToBigEndian, DecodeFromBigEndian,
|
||||||
|
c, t)
|
||||||
|
})
|
||||||
|
allData(func(c Coord) {
|
||||||
|
checkEncodeDecode(
|
||||||
|
"String - plain",
|
||||||
|
CoordToPlain,
|
||||||
|
EncodeStringToBytes, DecodeStringFromBytes,
|
||||||
|
c, t)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkJoinSplit(
|
func checkJoinSplit(
|
||||||
|
Loading…
Reference in New Issue
Block a user