浏览代码

Random number is too large for 32 bit archs (fixes #1894)

Jakob Borg 10 年之前
父节点
当前提交
c23a601cc6
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      cmd/syncthing/random_test.go

+ 6 - 2
cmd/syncthing/random_test.go

@@ -7,6 +7,7 @@
 package main
 
 import (
+	"runtime"
 	"sync"
 	"testing"
 )
@@ -14,10 +15,13 @@ import (
 var predictableRandomTest sync.Once
 
 func TestPredictableRandom(t *testing.T) {
+	if runtime.GOARCH != "amd64" {
+		t.Skip("Test only for 64 bit platforms; but if it works there, it should work on 32 bit")
+	}
 	predictableRandomTest.Do(func() {
 		// predictable random sequence is predictable
-		e := 3440579354231278675
-		if v := predictableRandom.Int(); v != e {
+		e := int64(3440579354231278675)
+		if v := int64(predictableRandom.Int()); v != e {
 			t.Errorf("Unexpected random value %d != %d", v, e)
 		}
 	})