~poldi1405/go-yenc

ref: db8820d1a641a361e795ea23f26415f1c5eec62d go-yenc/limit_test.go -rw-r--r-- 313 bytes
db8820d1 — Moritz Poldrack started work on encoder 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package yenc

import (
	"runtime"
	"testing"
)

func TestGetLimit(t *testing.T) {
	// this test is essentially useless, but hey… free coverage.

	limit := GetLimit()
	if runtime.NumCPU() > 8 {
		if limit != runtime.NumCPU()*16 {
			t.Fail()
		}
	} else {
		if limit != runtime.NumCPU()*4 {
			t.Fail()
		}
	}
}