File: fuse_kernel_test.go

package info (click to toggle)
golang-github-jacobsa-bazilfuse 0.0~git20150622-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 736 kB
  • sloc: sh: 26; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package bazilfuse_test

import (
	"os"
	"testing"
)

func TestOpenFlagsAccmodeMask(t *testing.T) {
	var f = fuse.OpenFlags(os.O_RDWR | os.O_SYNC)
	if g, e := f&fuse.OpenAccessModeMask, fuse.OpenReadWrite; g != e {
		t.Fatalf("OpenAccessModeMask behaves wrong: %v: %o != %o", f, g, e)
	}
	if f.IsReadOnly() {
		t.Fatalf("IsReadOnly is wrong: %v", f)
	}
	if f.IsWriteOnly() {
		t.Fatalf("IsWriteOnly is wrong: %v", f)
	}
	if !f.IsReadWrite() {
		t.Fatalf("IsReadWrite is wrong: %v", f)
	}
}

func TestOpenFlagsString(t *testing.T) {
	var f = fuse.OpenFlags(os.O_RDWR | os.O_SYNC | os.O_APPEND)
	if g, e := f.String(), "OpenReadWrite+OpenAppend+OpenSync"; g != e {
		t.Fatalf("OpenFlags.String: %q != %q", g, e)
	}
}