Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: go/src/infra/libs/bit_field/bf_test.go

Issue 1153883002: go: infra/libs/* now live in luci-go. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: move the rest too Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/libs/bit_field/bf.go ('k') | go/src/infra/libs/errors/errors.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/libs/bit_field/bf_test.go
diff --git a/go/src/infra/libs/bit_field/bf_test.go b/go/src/infra/libs/bit_field/bf_test.go
deleted file mode 100644
index 970fc40114b0ec398ff1330e3f9c0bd197f39fb7..0000000000000000000000000000000000000000
--- a/go/src/infra/libs/bit_field/bf_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package bf
-
-import (
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
-)
-
-func TestBitField(t *testing.T) {
- Convey("BitField", t, func() {
- bf := Make(2000)
-
- Convey("Should be sized right", func() {
- So(bf.Size(), ShouldEqual, 2000)
- So(len(bf.Data), ShouldEqual, 32)
- })
-
- Convey("Should be empty", func() {
- So(bf.All(false), ShouldBeTrue)
- So(bf.Data[0], ShouldEqual, 0)
- So(bf.CountSet(), ShouldEqual, 0)
- So(bf.IsSet(20), ShouldBeFalse)
- So(bf.IsSet(200001), ShouldBeFalse)
-
- Convey("and be unset", func() {
- for i := uint64(0); i < 20; i++ {
- So(bf.IsSet(i), ShouldBeFalse)
- }
- })
- })
-
- Convey("Boundary conditions are caught", func() {
- So(bf.Set(2000), ShouldNotBeNil)
- So(bf.Clear(2000), ShouldNotBeNil)
- })
-
- Convey("and setting [0, 1, 19, 197, 4]", func() {
- So(bf.Set(0), ShouldBeNil)
- So(bf.Set(1), ShouldBeNil)
- So(bf.Set(19), ShouldBeNil)
- So(bf.Set(197), ShouldBeNil)
- So(bf.Set(1999), ShouldBeNil)
- So(bf.Set(4), ShouldBeNil)
-
- Convey("should count correctly", func() {
- So(bf.CountSet(), ShouldEqual, 6)
- })
-
- Convey("should retrieve correctly", func() {
- So(bf.IsSet(2), ShouldBeFalse)
- So(bf.IsSet(18), ShouldBeFalse)
-
- So(bf.IsSet(0), ShouldBeTrue)
- So(bf.IsSet(1), ShouldBeTrue)
- So(bf.IsSet(4), ShouldBeTrue)
- So(bf.IsSet(19), ShouldBeTrue)
- So(bf.IsSet(197), ShouldBeTrue)
- So(bf.IsSet(1999), ShouldBeTrue)
- })
-
- Convey("should clear correctly", func() {
- So(bf.Clear(3), ShouldBeNil)
- So(bf.Clear(4), ShouldBeNil)
- So(bf.Clear(197), ShouldBeNil)
-
- So(bf.IsSet(2), ShouldBeFalse)
- So(bf.IsSet(3), ShouldBeFalse)
- So(bf.IsSet(18), ShouldBeFalse)
-
- So(bf.IsSet(4), ShouldBeFalse)
- So(bf.IsSet(197), ShouldBeFalse)
-
- So(bf.IsSet(0), ShouldBeTrue)
- So(bf.IsSet(1), ShouldBeTrue)
- So(bf.IsSet(19), ShouldBeTrue)
-
- So(bf.CountSet(), ShouldEqual, 4)
- })
- })
- })
-}
« no previous file with comments | « go/src/infra/libs/bit_field/bf.go ('k') | go/src/infra/libs/errors/errors.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698