Example #1
0
func TestParameterValidation(t *testing.T) {
	peer, _ := NewPeer(EPP8_d)
	bruss := problems.NewBruss2D(10)
	instance := bruss.Initialize()

	c := Config{
		BlockSize: 0,
		Fcn:       bruss.Fcn,
	}

	peer.Integrate(0, 1, instance, &c)

	if c.BlockSize == 0 {
		t.Errorf("Peer didn't correct block size.")
	}
}
Example #2
0
func TestAllPeer(t *testing.T) {
	if testing.Short() {
		t.Skipf("Skipping because we're running in short test mode.")
	}

	integrators := make([]Integrator, NumberOfPeerMethods)
	for j := 0; j < int(NumberOfPeerMethods); j++ {
		p, err := NewPeer(PeerMethod(j))
		if err != nil {
			t.Errorf("Couldn't create Peer Method %d: %s", j, err.Error())
		} else {
			integrators[j] = p
		}
	}

	RunIntegratorTests(t, integrators, 1)
}