Commit d6600466 authored by Ivan Krasin's avatar Ivan Krasin

The problem was in the test. I didn't allocate the memory for output...

The problem was in the test. I didn't allocate the memory for output parameter. But runtime was wrong with the line of code
parent b9d45b55
......@@ -15,12 +15,15 @@ type testFuse struct {}
func (fs *testFuse) Init(in *InitIn) (out *InitOut, code Error) {
if (in.Major != FUSE_KERNEL_VERSION) {
fmt.Printf("Major versions does not match. Given %d, want %d\n", in.Major, FUSE_KERNEL_VERSION)
return nil, EIO
code = EIO
return
}
if (in.Minor < FUSE_KERNEL_MINOR_VERSION) {
fmt.Printf("Minor version is less than we support. Given %d, want at least %d\n", in.Minor, FUSE_KERNEL_MINOR_VERSION)
return nil, EIO
code = EIO
return
}
out = new(InitOut)
out.Major = FUSE_KERNEL_VERSION
out.Minor = FUSE_KERNEL_MINOR_VERSION
out.MaxReadahead = 65536
......@@ -30,12 +33,12 @@ func (fs *testFuse) Init(in *InitIn) (out *InitOut, code Error) {
func TestMount(t *testing.T) {
fs := new(testFuse)
toW := make(chan [][]byte, 100)
errors := make(chan os.Error, 100)
// toW := make(chan [][]byte, 100)
// errors := make(chan os.Error, 100)
in_data := []byte { 56, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 13, 0, 0, 0, 0, 0, 2, 0, 123, 0, 0, 0, }
handle(fs, in_data, toW, errors)
return
// in_data := []byte { 56, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 13, 0, 0, 0, 0, 0, 2, 0, 123, 0, 0, 0, }
// handle(fs, in_data, toW, errors)
// return
err := os.Mkdir(tempMountDir, 0777)
if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment