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

Unified Diff: common/cmpbin/common_test.go

Issue 1219323002: Rename funnybase and add more serializations. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fixes Created 5 years, 5 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 | « common/cmpbin/binary_vals_test.go ('k') | common/cmpbin/doc.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/cmpbin/common_test.go
diff --git a/common/cmpbin/common_test.go b/common/cmpbin/common_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..b5c4292410ae6796c7c6515155dceaea344e8c55
--- /dev/null
+++ b/common/cmpbin/common_test.go
@@ -0,0 +1,31 @@
+// 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 cmpbin
+
+import (
+ "errors"
+ "flag"
+ "log"
+ "time"
+)
+
+var seed = flag.Int64("cmpbin.seed", time.Now().UnixNano(), "random seed for testing")
+
+var randomTestSize = 1000
+
+func init() {
+ flag.Parse()
+ log.Println("cmpbin.seed =", *seed)
+}
+
+type fakeWriter struct{ count int }
+
+func (f *fakeWriter) WriteByte(byte) error {
+ if f.count == 0 {
+ return errors.New("nope")
+ }
+ f.count--
+ return nil
+}
« no previous file with comments | « common/cmpbin/binary_vals_test.go ('k') | common/cmpbin/doc.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698