update tests

This commit is contained in:
Markus Tzoe 2017-04-19 10:47:35 +08:00
parent df301dd7ff
commit 7554c6e624
6 changed files with 11 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import (
)
func TestDecompress(t *testing.T) {
t.Parallel()
infile, err := os.Open("./data/sample.tta")
if err != nil {
t.Fatal(err)

View file

@ -6,6 +6,7 @@ import (
)
func TestCompress(t *testing.T) {
t.Parallel()
infile, err := os.Open("./data/sample.wav")
if err != nil {
t.Fatal(err)

View file

@ -5,6 +5,7 @@ import (
)
func TestReadByte(t *testing.T) {
t.Parallel()
fifo := ttaFifo{}
for i := 0; i < fifoBufferSize; i++ {
fifo.buffer[i] = byte(i)
@ -31,6 +32,7 @@ func TestReadByte(t *testing.T) {
}
func TestReadUint16(t *testing.T) {
t.Parallel()
fifo := ttaFifo{}
for i := 0; i < fifoBufferSize; i++ {
fifo.buffer[i] = byte(i)
@ -59,6 +61,7 @@ func TestReadUint16(t *testing.T) {
}
func TestReadUint32(t *testing.T) {
t.Parallel()
fifo := ttaFifo{}
for i := 0; i < fifoBufferSize; i++ {
fifo.buffer[i] = byte(i)
@ -87,6 +90,7 @@ func TestReadUint32(t *testing.T) {
}
func TestWriteByte(t *testing.T) {
t.Parallel()
fifo := ttaFifo{}
fifo.pos = 0
fifo.end = fifoBufferSize

View file

@ -9,6 +9,7 @@ import (
)
func TestComprehensive(t *testing.T) {
t.Parallel()
testfile := "tta_comprehensive_test.wav"
if info, err := os.Stat(testfile); err == nil {
if !info.IsDir() {

View file

@ -6,6 +6,7 @@ import (
)
func TestComputeKeyDigits(t *testing.T) {
t.Parallel()
var strs = [...]string{"whatisthis?", "1", "", "12", "089q3eoib*(*U(*#$", "~*)(*)@&("}
var digits = [...][8]byte{
{37, 121, 62, 136, 117, 151, 236, 181},
@ -24,6 +25,7 @@ func TestComputeKeyDigits(t *testing.T) {
}
func TestConvertPassword(t *testing.T) {
t.Parallel()
var strs = [...]string{
"",
"1",

View file

@ -12,6 +12,7 @@ var wavSlice = []byte{0x52, 0x49, 0x46, 0x46, 0x98, 0x03, 0x00, 0x00, 0x57, 0x41
var wavSize = uint32(0x0374)
func TestReadHeader(t *testing.T) {
t.Parallel()
file, err := os.Open("./data/sample.wav")
if err != nil {
t.Fatal(err)
@ -28,6 +29,7 @@ func TestReadHeader(t *testing.T) {
}
func TestWriteHeader(t *testing.T) {
t.Parallel()
filename := os.TempDir() + "/tta_tmp.wav"
file, err := os.Create(filename)
if err != nil {