Skip to content

Commit

Permalink
Merge pull request #36 from jpimbert/Issue#33-RelativeReferencePathInXML
Browse files Browse the repository at this point in the history
Issue#33 relative reference path in xml
  • Loading branch information
jpimbert committed Dec 20, 2014
2 parents 553cd3e + e647a27 commit 906891e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project/VBAToolKit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</reference>
<reference refID="r11">
<name>VBAToolKit</name>
<path>C:\Documents and Settings\Demonn\Application Data\Microsoft\AddIns\VBAToolKit.xlam</path>
<path>Microsoft\AddIns\VBAToolKit.xlam</path>
</reference>
<configuration cID="c1" refIDs="r1 r2 r3 r4 r5 r6 r7 r8 r9">
<name>VBAToolKit</name>
Expand Down
2 changes: 1 addition & 1 deletion Source/ConfProd/vtkXMLUtilities.bas
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Public Sub vtkExportConfigurationsAsXML(projectName As String, filePath As Strin
xmlFile.WriteLine Text:=" <reference refID=""" & ref.id & """>"
xmlFile.WriteLine Text:=" <name>" & ref.name & "</name>"
If ref.GUID Like "" Then
xmlFile.WriteLine Text:=" <path>" & ref.fullPath & "</path>"
xmlFile.WriteLine Text:=" <path>" & ref.relPath & "</path>"
Else
xmlFile.WriteLine Text:=" <guid>" & ref.GUID & "</guid>"
End If
Expand Down
18 changes: 18 additions & 0 deletions Source/ConfTest/vtkXMLExportTester.cls
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,22 @@ Test_vtkExportConfigurationsAsXML_correctRefContent_Error:
Exit Sub
End Sub

Public Sub Test_vtkExportConfigurationsAsXML_correctRefPath()
' modules -> correct content

On Error GoTo Test_vtkExportConfigurationsAsXML_correctRefContent_Error

mAssert.Equals reloadDom.SelectSingleNode("/vtkConf/reference/name[.=""VBAToolKit""]/../path").Text, "Microsoft\AddIns\VBAToolKit.xlam", "Relative Path for VBAToolKit reference"

On Error GoTo 0
Exit Sub

Test_vtkExportConfigurationsAsXML_correctRefContent_Error:
Err.Source = "Test_vtkExportConfigurationsAsXML_correctRefPath of module vtkXMLExportTester"
mAssert.Should False, "Unexpected error " & Err.Number & " (" & Err.Description & ") in " & Err.Source
Exit Sub
End Sub

Public Sub Test_vtkExportConfigurationsAsXML_NoProject()
' Verifies that an attempt to export a nonexistant project configuration raises the proper error

Expand Down Expand Up @@ -347,6 +363,7 @@ Private Function ITest_Suite() As TestSuite
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_correctReferenceNumber"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_correctRefNumByConf"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_correctRefContent"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_correctRefPath"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_NoProject"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_WrongPath"
ITest_Suite.AddTest ITest_Manager.ClassName, "Test_vtkExportConfigurationsAsXML_InexistantFile"
Expand All @@ -364,6 +381,7 @@ Private Sub ITestCase_RunTest()
Case "Test_vtkExportConfigurationsAsXML_correctReferenceNumber": Test_vtkExportConfigurationsAsXML_correctReferenceNumber
Case "Test_vtkExportConfigurationsAsXML_correctRefNumByConf": Test_vtkExportConfigurationsAsXML_correctRefNumByConf
Case "Test_vtkExportConfigurationsAsXML_correctRefContent": Test_vtkExportConfigurationsAsXML_correctRefContent
Case "Test_vtkExportConfigurationsAsXML_correctRefPath": Test_vtkExportConfigurationsAsXML_correctRefPath
Case "Test_vtkExportConfigurationsAsXML_NoProject": Test_vtkExportConfigurationsAsXML_NoProject
Case "Test_vtkExportConfigurationsAsXML_WrongPath": Test_vtkExportConfigurationsAsXML_WrongPath
Case "Test_vtkExportConfigurationsAsXML_InexistantFile": Test_vtkExportConfigurationsAsXML_InexistantFile
Expand Down

0 comments on commit 906891e

Please sign in to comment.