16
16
17
17
package com .sun .jna .platform .win32 ;
18
18
19
- import junit .framework .TestCase ;
19
+ import org .junit .*;
20
+ import static org .junit .Assert .*;
21
+ import static org .junit .Assume .*;
20
22
21
23
import com .sun .jna .Memory ;
22
24
import com .sun .jna .platform .win32 .Dxva2 ;
41
43
/**
42
44
* @author Martin Steiger
43
45
*/
44
- public class Dxva2Test extends TestCase {
46
+ public class Dxva2Test {
45
47
46
48
private int monitorCount ;
47
49
private PHYSICAL_MONITOR [] physMons ;
48
50
49
- @ Override
51
+ @ Before
50
52
public void setUp ()
51
53
{
52
54
HMONITOR hMonitor = User32 .INSTANCE .MonitorFromPoint (new POINT (0 , 0 ), WinUser .MONITOR_DEFAULTTOPRIMARY );
@@ -56,15 +58,17 @@ public void setUp()
56
58
57
59
monitorCount = pdwNumberOfPhysicalMonitors .getValue ().intValue ();
58
60
physMons = new PHYSICAL_MONITOR [monitorCount ];
59
- assertTrue (Dxva2 .INSTANCE .GetPhysicalMonitorsFromHMONITOR (hMonitor , monitorCount , physMons ).booleanValue ());
61
+
62
+ assumeTrue (Dxva2 .INSTANCE .GetPhysicalMonitorsFromHMONITOR (hMonitor , monitorCount , physMons ).booleanValue ());
60
63
}
61
64
62
- @ Override
65
+ @ After
63
66
public void tearDown ()
64
67
{
65
- assertTrue ( Dxva2 .INSTANCE .DestroyPhysicalMonitors (monitorCount , physMons ). booleanValue ());
68
+ Dxva2 .INSTANCE .DestroyPhysicalMonitors (monitorCount , physMons );
66
69
}
67
70
71
+ @ Test
68
72
public void testGetMonitorTechnologyType ()
69
73
{
70
74
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -75,6 +79,7 @@ public void testGetMonitorTechnologyType()
75
79
Dxva2 .INSTANCE .GetMonitorTechnologyType (hPhysicalMonitor , techType );
76
80
}
77
81
82
+ @ Test
78
83
public void testGetMonitorCapabilities ()
79
84
{
80
85
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -86,6 +91,7 @@ public void testGetMonitorCapabilities()
86
91
Dxva2 .INSTANCE .GetMonitorCapabilities (hPhysicalMonitor , caps , temps );
87
92
}
88
93
94
+ @ Test
89
95
public void testGetMonitorBrightness ()
90
96
{
91
97
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -98,6 +104,7 @@ public void testGetMonitorBrightness()
98
104
Dxva2 .INSTANCE .GetMonitorBrightness (hPhysicalMonitor , pdwMinimumBrightness , pdwCurrentBrightness , pdwMaximumBrightness );
99
105
}
100
106
107
+ @ Test
101
108
public void testGetMonitorContrast ()
102
109
{
103
110
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -110,6 +117,7 @@ public void testGetMonitorContrast()
110
117
Dxva2 .INSTANCE .GetMonitorContrast (hPhysicalMonitor , pdwMinimumContrast , pdwCurrentContrast , pdwMaximumContrast );
111
118
}
112
119
120
+ @ Test
113
121
public void testGetMonitorColorTemperature ()
114
122
{
115
123
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -120,6 +128,7 @@ public void testGetMonitorColorTemperature()
120
128
Dxva2 .INSTANCE .GetMonitorColorTemperature (hPhysicalMonitor , pctCurrentColorTemperature );
121
129
}
122
130
131
+ @ Test
123
132
public void testCapabilitiesRequestAndCapabilitiesReply ()
124
133
{
125
134
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -134,6 +143,7 @@ public void testCapabilitiesRequestAndCapabilitiesReply()
134
143
Dxva2 .INSTANCE .CapabilitiesRequestAndCapabilitiesReply (hPhysicalMonitor , pszASCIICapabilitiesString , capStrLen );
135
144
}
136
145
146
+ @ Test
137
147
public void testGetMonitorDisplayAreaPosition ()
138
148
{
139
149
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -147,6 +157,7 @@ public void testGetMonitorDisplayAreaPosition()
147
157
Dxva2 .INSTANCE .GetMonitorDisplayAreaPosition (hPhysicalMonitor , ptPositionType , pdwMinimumPosition , pdwCurrentPosition , pdwMaximumPosition );
148
158
}
149
159
160
+ @ Test
150
161
public void testGetMonitorDisplayAreaSize ()
151
162
{
152
163
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -160,6 +171,7 @@ public void testGetMonitorDisplayAreaSize()
160
171
Dxva2 .INSTANCE .GetMonitorDisplayAreaSize (hPhysicalMonitor , ptSizeType , pdwMinimumSize , pdwCurrentSize , pdwMaximumSize );
161
172
}
162
173
174
+ @ Test
163
175
public void testGetMonitorRedGreenOrBlueGain ()
164
176
{
165
177
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -173,6 +185,7 @@ public void testGetMonitorRedGreenOrBlueGain()
173
185
Dxva2 .INSTANCE .GetMonitorRedGreenOrBlueGain (hPhysicalMonitor , ptGainType , pdwMinimumGain , pdwCurrentGain , pdwMaximumGain );
174
186
}
175
187
188
+ @ Test
176
189
public void testGetMonitorRedGreenOrBlueDrive ()
177
190
{
178
191
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
@@ -186,6 +199,7 @@ public void testGetMonitorRedGreenOrBlueDrive()
186
199
Dxva2 .INSTANCE .GetMonitorRedGreenOrBlueDrive (hPhysicalMonitor , ptDriveType , pdwMinimumDrive , pdwCurrentDrive , pdwMaximumDrive );
187
200
}
188
201
202
+ @ Test
189
203
public void testGetTimingReport ()
190
204
{
191
205
HANDLE hPhysicalMonitor = physMons [0 ].hPhysicalMonitor ;
0 commit comments