Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit d7752579 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

added hash sort test file and test case for TorqueConverter

parent fa030bee
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.10.1" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.10" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.3" xmlns:v2.6="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.6" xmlns:v2.10.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.1" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd">
<tns:TorqueConverter xsi:type="v2.0:TorqueConverterComponentDeclarationType">
<v2.0:Data xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="TorqueConverterDataDeclarationType" id="TC-asdf">
<Manufacturer>Generic Vendor</Manufacturer>
<Model>Generic Model</Model>
<CertificationNumber>TC-1234</CertificationNumber>
<Date>2021-11-18T14:09:17.2810263Z</Date>
<AppVersion>aaaaa</AppVersion>
<CertificationMethod>Measured</CertificationMethod>
<Characteristics>
<Entry speedRatio='0.1000' torqueRatio='1.71' inputTorqueRef='355.43'/>
<Entry speedRatio='0.0000' torqueRatio='1.75' inputTorqueRef='367.68'/>
<Entry speedRatio='0.1000' torqueRatio='1.72' inputTorqueRef='355.42'/>
<Entry speedRatio='0.0000' torqueRatio='1.80' inputTorqueRef='367.65'/>
</Characteristics>
</v2.0:Data>
<v2.0:Signature>
<di:Reference URI="#TC-asdf">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" />
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<di:DigestValue>fw0SEYiGgZbq0YvrICrfQYgsDJTbz/s66w7EM2kezio=</di:DigestValue>
</di:Reference>
</v2.0:Signature>
</tns:TorqueConverter>
</tns:VectoInputDeclaration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.10.1" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.10" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.3" xmlns:v2.6="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.6" xmlns:v2.10.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.1" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd">
<tns:TorqueConverter xsi:type="v2.0:TorqueConverterComponentDeclarationType">
<v2.0:Data xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="TorqueConverterDataDeclarationType" id="TC-asdf">
<Manufacturer>Generic Vendor</Manufacturer>
<Model>Generic Model</Model>
<CertificationNumber>TC-1234</CertificationNumber>
<Date>2021-11-18T14:09:17.2810263Z</Date>
<AppVersion>aaaaa</AppVersion>
<CertificationMethod>Measured</CertificationMethod>
<Characteristics>
<Entry speedRatio='0.0000' torqueRatio='1.75' inputTorqueRef='367.68'/>
<Entry speedRatio='0.0000' torqueRatio='1.80' inputTorqueRef='367.65'/>
<Entry speedRatio='0.1000' torqueRatio='1.71' inputTorqueRef='355.43'/>
<Entry speedRatio='0.1000' torqueRatio='1.72' inputTorqueRef='355.42'/>
</Characteristics>
</v2.0:Data>
<v2.0:Signature>
<di:Reference URI="#TC-asdf">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" />
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<di:DigestValue>fw0SEYiGgZbq0YvrICrfQYgsDJTbz/s66w7EM2kezio=</di:DigestValue>
</di:Reference>
</v2.0:Signature>
</tns:TorqueConverter>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -65,6 +65,15 @@ namespace VectoHashingTest
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.Retarder));
}
[TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", @"Testdata\XML\Sort\TorqueConverter.xml"),
TestCase("o5/ZtRQ8nAui3rhM6adKiHVU9jRync6f1cDlBcnyOg4=", @"Testdata\XML\Sort\TorqueConverter_unsorted.xml")]
public void TestTorqueConverterComponentHashSort(string expectedHash, string filePath)
{
var loadedFile = VectoHash.Load(filePath);
Assert.AreEqual(expectedHash, loadedFile.ComputeHash(VectoComponents.TorqueConverter));
}
[TestCase("NiyH2Xp0rQswwXIOf52Jm0wvK4Yc2/PL/T+zQCWQGFo=", @"Testdata\XML\Sort\ADC_unsorted.xml")]
public void TestADCHashSort(string expectedHash, string filePath)
......
......@@ -141,6 +141,12 @@
<Content Include="Testdata\XML\Sort\Retarder_unsorted.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\TorqueConverter.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\Sort\TorqueConverter_unsorted.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\multiple_components.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment