Initial commit after restructure

This commit is contained in:
Daniel
2018-08-13 14:14:27 +02:00
commit bdeddc41f9
177 changed files with 26108 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
// Copyright Safing ICS Technologies GmbH. Use of this source code is governed by the AGPL license that can be found in the LICENSE file.
package process
import (
"fmt"
"strconv"
"testing"
)
func TestGetHumanInfo(t *testing.T) {
// gather processes for testing
pids := readDirNames("/proc")
var allProcs []*Process
for _, pidString := range pids {
pid, err := strconv.ParseInt(pidString, 10, 32)
if err != nil {
continue
}
next, err := GetOrFindProcess(int(pid))
if err != nil {
continue
}
allProcs = append(allProcs, next)
}
// test
for _, process := range allProcs {
process.GetHumanInfo()
fmt.Printf("%d - %s - %s - %s\n", process.Pid, process.Path, process.Name, process.Icon)
}
}