forked from gotmc/libusb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion_test.go
More file actions
36 lines (33 loc) · 898 Bytes
/
version_test.go
File metadata and controls
36 lines (33 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2015-2017 The libusb developers. All rights reserved.
// Project site: https://github.com/gotmc/libusb
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE.txt file for the project.
package libusb
import "testing"
func TestGetVersion(t *testing.T) {
const major = 1
const minor = 0
const minMicro = 17
releaseCandidate := ""
version := GetVersion()
if version.Major != major {
t.Errorf(
"Major version == %d, want %d",
version.Major, major)
}
if version.Minor != minor {
t.Errorf(
"Minor version == %d, want %d",
version.Minor, minor)
}
if version.Micro < minMicro {
t.Errorf(
"Micro version == %d, need at least %d",
version.Micro, minMicro)
}
if version.ReleaseCandidate != releaseCandidate {
t.Errorf(
"ReleaseCandidate == %v, want %v",
version.ReleaseCandidate, releaseCandidate)
}
}