Browse Source

fix test

pull/1115/head
Chris Lu 5 years ago
parent
commit
cd7ce720c7
  1. 6
      weed/storage/needle/needle_read_write_test.go

6
weed/storage/needle/needle_read_write_test.go

@ -5,6 +5,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/chrislusf/seaweedfs/weed/storage/backend"
"github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/storage/types"
) )
@ -54,7 +55,10 @@ func TestAppend(t *testing.T) {
os.Remove(tempFile.Name()) os.Remove(tempFile.Name())
}() }()
offset, _, _, _ := n.Append(tempFile, CurrentVersion)
datBackend := backend.NewDiskFile(tempFile.Name(), tempFile)
defer datBackend.Close()
offset, _, _, _ := n.Append(datBackend, CurrentVersion)
if offset != uint64(fileSize) { if offset != uint64(fileSize) {
t.Errorf("Fail to Append Needle.") t.Errorf("Fail to Append Needle.")
} }

Loading…
Cancel
Save