-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to access GroupHandle and FieldHandle
Signed-off-by: Rohit Arora <[email protected]>
- Loading branch information
1 parent
150a87b
commit b23a382
Showing
4 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dcgm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFieldHandle(t *testing.T) { | ||
fh := FieldHandle{} | ||
assert.Equal(t, uintptr(0), fh.GetHandle(), "value mismatch") | ||
|
||
inputs := []uintptr{1000, 0, 1, 10, 11, 50, 100, 1939902, 9992932938239, 999999999999999999} | ||
|
||
for _, input := range inputs { | ||
fh.SetHandle(input) | ||
assert.Equal(t, input, fh.GetHandle(), "values mismatch") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dcgm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGroupHandle(t *testing.T) { | ||
gh := GroupHandle{} | ||
assert.Equal(t, uintptr(0), gh.GetHandle(), "value mismatch") | ||
|
||
inputs := []uintptr{1000, 0, 1, 10, 11, 50, 100, 1939902, 9992932938239, 999999999999999999} | ||
|
||
for _, input := range inputs { | ||
gh.SetHandle(input) | ||
assert.Equal(t, input, gh.GetHandle(), "values mismatch") | ||
} | ||
} |