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

Skip to content
Snippets Groups Projects
Commit a64e72d1 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

fix #526: VTP report status: cvtp & sim finished

Problem: The VTP report 'Status' element would
have the value 'Passed' even if the simulation
had failed.

Solution: the value of the 'Status' element takes
into account whether the simulation finished
successfully.
parent 5e47f1d8
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using LogManager = NLog.LogManager;
using static TUGraz.VectoCore.Models.Simulation.Data.VectoRunData;
using static TUGraz.VectoCore.Models.Declaration.PT1;
using TUGraz.VectoCore.Models.Simulation.Impl;
[assembly: InternalsVisibleTo("VectoCoreTest")]
......@@ -341,11 +342,12 @@ namespace TUGraz.VectoCore.OutputData.XML
if (result == null) {
throw new VectoException("no corresponding simulation result found for generating vtp report");
}
var verifiedCO2 = declaredCO2 * cVtp.Value();
ResultsPart.Add(
new XElement(tns + "Status", cVtp < 1.075 ? "Passed" : "Failed"),
new XElement(tns + "Status",
(cVtp < 1.075) && (vtpResult.Status == VectoRun.Status.Success) ? "Passed" : "Failed"),
new XElement(
tns + "AverageFanPower",
new XAttribute(XMLNames.Report_Results_Unit_Attr, "kW"),
......
......@@ -144,11 +144,13 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
var declared = vtpXml.Document?.XPathSelectElement("//*[local-name()='Declared']")?.Value.ToDouble();
var cvtp = vtpXml.Document?.XPathSelectElement("//*[local-name()='C_VTP']")?.Value.ToDouble();
var status = vtpXml.Document?.XPathSelectElement("//*[local-name()='Status']")?.Value;
TestContext.WriteLine($"declared CO2 = {declared}, cvtp = {cvtp}");
Assert.AreEqual(expectedDeclaredCO2, declared, 1e-8);
Assert.AreEqual(expectedCVTP, cvtp, 1e-4);
Assert.AreEqual(status, "Passed");
}
[Category("LongRunning")]
......
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