01: // $Id: CalibrationMeasurement.java,v 1.1.1.1 2003/07/02 15:30:45 apopovic Exp $
02: // =====================================================================
03: //
04: // (history at end)
05: //
06:
07: package measurements.suites;
08:
09: // used packages
10: import junit.framework.Test;
11: import ch.ethz.inf.util.junit.PerformanceTest;
12: import ch.ethz.inf.util.junit.PerformanceTestSuite;
13:
14: /**
15: * JUnit testcase for testing how fast is the framework itself
16: * if we let'it run without measuring anything (void calls in
17: * the <code>RUNS</code> loop).
18: *
19: * @version $Revision: 1.1.1.1 $
20: * @author Andrei Popovici
21: */
22: public class CalibrationMeasurement extends PerformanceTest {
23:
24: // fixture
25: {
26: RANGE = new int[] { 20000000 };
27: }
28:
29: public void theMethodToCall() {
30: int a;
31: a = 1;
32: }
33:
34: /**
35: * Construct test with given name.
36: * @param name test name
37: */
38: public CalibrationMeasurement(String name) {
39: super (name);
40: }
41:
42: /**
43: * Set up fixture.
44: */
45: protected void setUp() {
46: }
47:
48: /**
49: *
50: */
51: protected void tearDown() {
52: }
53:
54: public void testVoid() {
55: startChronometer();
56: for (int i = 0; i < RUNS; i++) {
57: }
58: stopChronometer();
59: }
60:
61: public void testLocalCalls() {
62: startChronometer();
63: for (int i = 0; i < RUNS; i++) {
64: theMethodToCall();
65: }
66: stopChronometer();
67: }
68:
69: /**
70: * Test suite.
71: * @return test instance
72: */
73: public static Test suite() {
74: return new PerformanceTestSuite(CalibrationMeasurement.class);
75: }
76:
77: }
78:
79: //======================================================================
80: //
81: // $Log: CalibrationMeasurement.java,v $
82: // Revision 1.1.1.1 2003/07/02 15:30:45 apopovic
83: // Imported from ETH Zurich
84: //
85: // Revision 1.3 2003/03/04 18:36:00 popovici
86: // Organization of imprts
87: //
88: // Revision 1.2 2002/02/15 12:31:09 smarkwal
89: // minor changes like spaces/tabs, setUp
90: //
91: // Revision 1.1.1.1 2001/11/29 18:13:34 popovici
92: // Sources from runes
93: //
94: // Revision 1.1.2.2 2001/02/07 12:07:41 popovici
95: // measurement 'testLocalCalls' added to the calibration Measurement.
96: //
97: // Revision 1.1.2.1 2000/11/30 19:27:22 popovici
98: // Initial Revision
99: //
|