Version bump.
[stompngo_examples.git] / sngecomm / environment_test.go
blobad342beb7e0c540ab1cf624e98067eadedffb199
1 //
2 // Copyright © 2016-2018 Guy M. Allard
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 package sngecomm
19 import (
20 "testing"
24 Test sngecomm defaults. Must run with no environment variables set.
26 func TestEnvironmentDefaults(t *testing.T) {
27 n := Nqs()
28 if n != 1 {
29 t.Errorf("sngecomm Nqs, expected [%d], got [%d]\n", 1, n)
32 n = Mdml()
33 if n != 1024*32 {
34 t.Errorf("sngecomm Mdml, expected [%d], got [%d]\n", 1024*32, n)
37 b := Pprof()
38 if b {
39 t.Errorf("sngecomm Pprof, expected [%t], got [%t]\n", false, b)
42 s := AckMode()
43 if s != "auto" {
44 t.Errorf("sngecomm AckMode, expected [%s], got [%s]\n", "auto", s)
47 f := SendFactor()
48 if f != 1.0 {
49 t.Errorf("sngecomm SendFactor, expected [%v], got [%v]\n", 1.0, n)
52 f = RecvFactor()
53 if f != 1.0 {
54 t.Errorf("sngecomm RecvFactor, expected [%v], got [%v]\n", 1.0, n)
57 n = Pbc()
58 if n != 64 {
59 t.Errorf("sngecomm Pbc, expected [%v], got [%v]\n", 64, n)
62 b = RecvWait()
63 if !b {
64 t.Errorf("sngecomm RecvWait, expected [%t], got [%t]\n", true, b)
67 b = SendWait()
68 if !b {
69 t.Errorf("sngecomm SendWait, expected [%t], got [%t]\n", true, b)
72 b = SetMAXPROCS()
73 if b {
74 t.Errorf("sngecomm SetMAXPROCS, expected [%t], got [%t]\n", false, b)