mirror of
https://github.com/gonum/gonum.git
synced 2025-10-01 13:32:12 +08:00
spatial/barneshut: make tests parallel
This commit is contained in:
@@ -342,6 +342,7 @@ var planeTests = []struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPlane(t *testing.T) {
|
func TestPlane(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
const tol = 1e-15
|
const tol = 1e-15
|
||||||
|
|
||||||
for _, test := range planeTests {
|
for _, test := range planeTests {
|
||||||
@@ -408,6 +409,7 @@ func walkPlane(t *tile, fn func(*tile)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPlaneForceOn(t *testing.T) {
|
func TestPlaneForceOn(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
const (
|
const (
|
||||||
size = 1000
|
size = 1000
|
||||||
tol = 0.07
|
tol = 0.07
|
||||||
@@ -436,7 +438,9 @@ func TestPlaneForceOn(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
|
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
|
||||||
|
theta := theta
|
||||||
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
|
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
var ssd, sd float64
|
var ssd, sd float64
|
||||||
var calls int
|
var calls int
|
||||||
for i, p := range particles {
|
for i, p := range particles {
|
||||||
|
@@ -337,6 +337,7 @@ var volumeTests = []struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestVolume(t *testing.T) {
|
func TestVolume(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
const tol = 1e-15
|
const tol = 1e-15
|
||||||
|
|
||||||
for _, test := range volumeTests {
|
for _, test := range volumeTests {
|
||||||
@@ -405,6 +406,7 @@ func walkVolume(t *bucket, fn func(*bucket)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestVolumeForceOn(t *testing.T) {
|
func TestVolumeForceOn(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
const (
|
const (
|
||||||
size = 1000
|
size = 1000
|
||||||
tol = 1e-3
|
tol = 1e-3
|
||||||
@@ -433,7 +435,9 @@ func TestVolumeForceOn(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
|
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
|
||||||
|
theta := theta
|
||||||
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
|
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
var ssd, sd float64
|
var ssd, sd float64
|
||||||
var calls int
|
var calls int
|
||||||
for i, p := range particles {
|
for i, p := range particles {
|
||||||
|
Reference in New Issue
Block a user