Skip to content

Commit

Permalink
Longer explanation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Jan 23, 2023
1 parent 1f2e3bc commit fa87a0a
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 47 deletions.
18 changes: 9 additions & 9 deletions BitSliceIndexing/bsi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,47 +266,47 @@ func TestLargeFile(t *testing.T) {

datEBM, err := ioutil.ReadFile("./testdata/age/EBM")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat1, err := ioutil.ReadFile("./testdata/age/1")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat2, err := ioutil.ReadFile("./testdata/age/2")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat3, err := ioutil.ReadFile("./testdata/age/3")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat4, err := ioutil.ReadFile("./testdata/age/4")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat5, err := ioutil.ReadFile("./testdata/age/5")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat6, err := ioutil.ReadFile("./testdata/age/6")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat7, err := ioutil.ReadFile("./testdata/age/7")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat8, err := ioutil.ReadFile("./testdata/age/8")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down
18 changes: 9 additions & 9 deletions roaring64/bsi64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,47 +266,47 @@ func TestLargeFile(t *testing.T) {

datEBM, err := ioutil.ReadFile("./testdata/age/EBM")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat1, err := ioutil.ReadFile("./testdata/age/1")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat2, err := ioutil.ReadFile("./testdata/age/2")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat3, err := ioutil.ReadFile("./testdata/age/3")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat4, err := ioutil.ReadFile("./testdata/age/4")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat5, err := ioutil.ReadFile("./testdata/age/5")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat6, err := ioutil.ReadFile("./testdata/age/6")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat7, err := ioutil.ReadFile("./testdata/age/7")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
dat8, err := ioutil.ReadFile("./testdata/age/8")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down
8 changes: 4 additions & 4 deletions roaring64/roaring64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ func Test_tryReadFromRoaring32(t *testing.T) {
func Test_tryReadFromRoaring32_File(t *testing.T) {
tempDir, err := ioutil.TempDir("./", "testdata")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
defer os.RemoveAll(tempDir)
Expand All @@ -2019,7 +2019,7 @@ func Test_tryReadFromRoaring32_File(t *testing.T) {
}
file, err := os.Open(name)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
defer file.Close()
Expand Down Expand Up @@ -2049,7 +2049,7 @@ func Test_tryReadFromRoaring32WithRoaring64(t *testing.T) {
func Test_tryReadFromRoaring32WithRoaring64_File(t *testing.T) {
tempDir, err := ioutil.TempDir("./", "testdata")
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
defer os.RemoveAll(tempDir)
Expand All @@ -2066,7 +2066,7 @@ func Test_tryReadFromRoaring32WithRoaring64_File(t *testing.T) {
}
file, err := os.Open(name)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
defer file.Close()
Expand Down
6 changes: 3 additions & 3 deletions roaring64/serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ func TestSerializationToFile038(t *testing.T) {
fname := "myfile.bin"
fout, err := os.OpenFile(fname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0660)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

var l int64
l, err = rb.WriteTo(fout)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -82,7 +82,7 @@ func TestSerializationToFile038(t *testing.T) {
newrb := NewBitmap()
fin, err := os.Open(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down
20 changes: 14 additions & 6 deletions serialization_frozen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"io/ioutil"
"reflect"
"testing"
"os"
"fmt"
)

func TestFrozenFormat(t *testing.T) {
Expand Down Expand Up @@ -47,11 +49,13 @@ func TestFrozenFormat(t *testing.T) {

frozenBuf, err := ioutil.ReadFile(fpath)
if err != nil {
t.Fatalf("failed to open %s: %s", fpath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
portableBuf, err := ioutil.ReadFile(ppath)
if err != nil {
t.Fatalf("failed to open %s: %s", ppath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

frozen, portable := New(), New()
Expand All @@ -71,11 +75,13 @@ func TestFrozenFormat(t *testing.T) {

frozenBuf, err := ioutil.ReadFile(fpath)
if err != nil {
t.Fatalf("failed to open %s: %s", fpath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
portableBuf, err := ioutil.ReadFile(ppath)
if err != nil {
t.Fatalf("failed to open %s: %s", ppath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

portable := New()
Expand All @@ -100,11 +106,13 @@ func TestFrozenFormat(t *testing.T) {

frozenBuf, err := ioutil.ReadFile(fpath)
if err != nil {
t.Fatalf("failed to open %s: %s", fpath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
portableBuf, err := ioutil.ReadFile(ppath)
if err != nil {
t.Fatalf("failed to open %s: %s", ppath, err)
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

portable := New()
Expand Down
32 changes: 16 additions & 16 deletions serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ func TestSerializationToFile038(t *testing.T) {
fname := "myfile.bin"
fout, err := os.OpenFile(fname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0660)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

var l int64
l, err = rb.WriteTo(fout)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -86,7 +86,7 @@ func TestSerializationToFile038(t *testing.T) {
newrb := NewBitmap()
fin, err := os.Open(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -104,7 +104,7 @@ func TestSerializationReadRunsFromFile039(t *testing.T) {

by, err := ioutil.ReadFile(fn)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -131,7 +131,7 @@ func TestSerializationBasic4WriteAndReadFile040(t *testing.T) {
rb.highlowcontainer.runOptimize()
fout, err := os.Create(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -140,15 +140,15 @@ func TestSerializationBasic4WriteAndReadFile040(t *testing.T) {
l, err = rb.WriteTo(fout)

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}
assert.EqualValues(t, l, rb.GetSerializedSizeInBytes())

fout.Close()
fin, err := os.Open(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -166,7 +166,7 @@ func TestSerializationFromJava051(t *testing.T) {
newrb := NewBitmap()
fin, err := os.Open(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down Expand Up @@ -196,7 +196,7 @@ func TestSerializationFromJavaWithRuns052(t *testing.T) {
newrb := NewBitmap()
fin, err := os.Open(fname)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down Expand Up @@ -454,7 +454,7 @@ func TestBitmap_FromBuffer(t *testing.T) {

buf, err := ioutil.ReadFile(file)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -471,7 +471,7 @@ func TestBitmap_FromBuffer(t *testing.T) {
buf, err := ioutil.ReadFile(fn)

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -487,7 +487,7 @@ func TestBitmap_FromBuffer(t *testing.T) {
buf, err := ioutil.ReadFile(file)

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -502,7 +502,7 @@ func TestBitmap_FromBuffer(t *testing.T) {
buf, err := ioutil.ReadFile(file)

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down Expand Up @@ -536,7 +536,7 @@ func TestBitmap_FromBuffer(t *testing.T) {
buf, err := ioutil.ReadFile(file)

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand All @@ -555,14 +555,14 @@ func TestSerializationCrashers(t *testing.T) {
crashers, err := filepath.Glob("testdata/crash*")

if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

for _, crasher := range crashers {
data, err := ioutil.ReadFile(crasher)
if(err != nil) {
fmt.Fprintf(os.Stderr, "IMPORTANT: For testing file IO, the roaring library requires disk access.")
fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
return
}

Expand Down

0 comments on commit fa87a0a

Please sign in to comment.