Skip to content

Commit

Permalink
Merge branch 'master' into dev/psym
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-goel committed Oct 6, 2023
2 parents a56fdaf + f0b286f commit 224e39d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions Src/PChecker/CheckerCore/Coverage/ActivityCoverageReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal void WriteCoverageText(TextWriter writer)
foreach (var machine in machines)
{
machineTypes.TryGetValue(machine, out var machineType);
WriteHeader(writer, string.Format("{0}: {1}", machineType, machine));
WriteHeader(writer, string.Format("{0}: {1}", machineType, GetSanitizedName(machine)));

// find all possible events for this machine.
var uncoveredMachineEvents = new Dictionary<string, HashSet<string>>();
Expand Down Expand Up @@ -314,7 +314,11 @@ private IEnumerable<string> GetPushedStates(string stateId)

private static List<string> SortHashSet(HashSet<string> items)
{
var sorted = new List<string>(items);
var sorted = new List<string>();
foreach (var i in items)
{
sorted.Add(GetSanitizedName(i));
}
sorted.Sort();
return sorted;
}
Expand Down Expand Up @@ -349,5 +353,16 @@ private static string GetMachineId(string nodeId)

private static string GetStateId(string machineName, string stateName) =>
string.Format("{0}::{1}", stateName, machineName);

private static string GetSanitizedName(string name)
{
var i = name.LastIndexOf(".");
if (i > 0)
{
return name.Substring(i + 1);
}

return name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void OnMonitorExecuteAction(string monitorType, string stateName, string
public void OnMonitorProcessEvent(string monitorType, string stateName, string senderName,
string senderType, string senderStateName, Event e)
{
EventCoverage.AddEventReceived(GetStateId(monitorType, stateName), e.GetType().Name);
EventCoverage.AddEventReceived(GetStateId(monitorType, stateName), e.GetType().FullName);
}

public void OnMonitorRaiseEvent(string monitorType, string stateName, Event e)
Expand Down

0 comments on commit 224e39d

Please sign in to comment.