Testing

Building the DLL

On the File menu, choose Make projectname.dll… You must correct any compile errors before completing this step.

Binary compatibility

Like any ActiveX DLL, you want your server to be binary compatible, so that future versions of the server can be deployed on a client machine simply by replacing the old file with the new file. To do this:

Independent Testing

First, we will test the interval server independent of the PITimeServer.

Private Sub Form_Load()
Dim intv As ITimeIntervals
  
  Set intv = New Intervals
  
  Debug.Print intv.Name
  Debug.Print intv.Description
  Debug.Print "Count = "; intv.Count

Dim i As Integer, j As Integer
Dim ti As ITimeInterval
Dim pt As PITime
  
  For i = 1 To intv.Count
     
    Set ti = intv.Item(i)
     
    With ti
      Debug.Print .Name & " (" & _

      .PluralName & ", " & .ShortName & ")"
      Debug.Print "Ordinals: " & _
      .MemberLo & "-" & .MemberHi
        
      On Error GoTo NONAME
        
      For j = .MemberLo To .MemberHi
        Debug.Print .MemberName(j) & _
              " (" & .MemberShortName(j) & ")"
      Next

NONAME: 
      If Err Then Debug.Print "Members have no names"
      On Error GoTo 0
      Set pt = New PITime
      pt.SetToCurrent
      Debug.Print "Current ordinal = " & .Ordinal(pt)
      Debug.Print "Current start time = " & _
      .StartTime(pt)
      Debug.Print "Plus two intervals = " & _
      .AddIntervals(pt, 2)
      Debug.Print "Minus two intervals = " & _
      .AddIntervals(pt, -2)
      Debug.Print "Next instance of ord " & _
      .MemberLo & ": " & _
      .FindMember(pt, .MemberLo, fiAfter)
      Debug.Print "Next instance of ord " & _
      .MemberHi & ": " & _
      .FindMember(pt, .MemberHi, fiAfter)
      Debug.Print "Previous instance of ord " & _
      .MemberLo & ": " & _
      .FindMember(pt, .MemberLo, fiBefore)
      Debug.Print "Previous instance of ord " & _
      .MemberHi & ": " & _
      .FindMember(pt, .MemberHi, fiBefore)
    End With
  Next
End Sub

Integrated Testing

Next
Enabling Operational Intelligence