1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-28 13:48:56 +08:00

edf: corrections for Travis environment

This commit is contained in:
Richard Townsend 2014-08-03 16:20:23 +01:00
parent 7f7d914732
commit d13654021f
3 changed files with 8 additions and 8 deletions

View File

@ -44,9 +44,9 @@ func TestAllocWithExtraContentsBlock(t *testing.T) {
Convey("Mapping the file should suceed", func() { Convey("Mapping the file should suceed", func() {
mapping, err := EdfMap(tempFile, EDF_CREATE) mapping, err := EdfMap(tempFile, EDF_CREATE)
So(err, ShouldEqual, nil) So(err, ShouldEqual, nil)
Convey("Allocation of 350 pages should suceed", func() { Convey("Allocation of 10 pages should suceed", func() {
allocated := make([]EdfRange, 350) allocated := make([]EdfRange, 10)
for i := 0; i < 350; i++ { for i := 0; i < 10; i++ {
r, err := mapping.AllocPages(1, 2) r, err := mapping.AllocPages(1, 2)
So(err, ShouldEqual, nil) So(err, ShouldEqual, nil)
allocated[i] = r allocated[i] = r
@ -59,7 +59,7 @@ func TestAllocWithExtraContentsBlock(t *testing.T) {
Convey("Should get the same allocations back", func() { Convey("Should get the same allocations back", func() {
rr, err := mapping.GetThreadBlocks(2) rr, err := mapping.GetThreadBlocks(2)
So(err, ShouldEqual, nil) So(err, ShouldEqual, nil)
So(len(rr), ShouldEqual, 350) So(len(rr), ShouldEqual, 10)
So(rr, ShouldResemble, allocated) So(rr, ShouldResemble, allocated)
}) })
}) })

View File

@ -14,11 +14,11 @@ const (
// EDF_VERSION is the file format version // EDF_VERSION is the file format version
EDF_VERSION = 1 EDF_VERSION = 1
// EDF_LENGTH is th number of OS pages in each slice // EDF_LENGTH is th number of OS pages in each slice
EDF_LENGTH = 1024 * 1024 EDF_LENGTH = 32
// EDF_SIZE sets the maximum size of the mapping, represented with // EDF_SIZE sets the maximum size of the mapping, represented with
// EDF_LENGTH segments // EDF_LENGTH segments
// Currently set arbitrarily to 4 GiB // Currently set arbitrarily to 128 MiB
EDF_SIZE = 4 * (1024 * 1024 * 1024) EDF_SIZE = 128 * (1024 * 1024)
) )
const ( const (

View File

@ -75,7 +75,7 @@ func (l *LazilyFilteredInstances) AllAttributes() []Attribute {
for i, a := range l.attrs { for i, a := range l.attrs {
ret[i] = a.New ret[i] = a.New
} }
for a := range l.unfilteredMap { for _, a := range l.src.AllAttributes() {
if l.unfilteredMap[a] { if l.unfilteredMap[a] {
ret = append(ret, a) ret = append(ret, a)
} }