/// <summary> /// Merges the information from the specified coverage info. This is not thread-safe. /// </summary> public void Merge(CoverageInfo coverageInfo) { foreach (var machine in coverageInfo.Machines) { this.Machines.Add(machine); } foreach (var machine in coverageInfo.MachinesToStates) { foreach (var state in machine.Value) { this.DeclareMachineState(machine.Key, state); } } foreach (var tup in coverageInfo.RegisteredEvents) { foreach (var e in tup.Value) { this.InternalAddEvent(tup.Key, e); } } if (this.CoverageGraph is null) { this.CoverageGraph = coverageInfo.CoverageGraph; } else if (coverageInfo.CoverageGraph != null && this.CoverageGraph != coverageInfo.CoverageGraph) { this.CoverageGraph.Merge(coverageInfo.CoverageGraph); } if (this.EventInfo is null) { this.EventInfo = coverageInfo.EventInfo; } else if (coverageInfo.EventInfo != null && this.EventInfo != coverageInfo.EventInfo) { this.EventInfo.Merge(coverageInfo.EventInfo); } }
internal void Merge(EventCoverage other) { MergeHashSets(this.EventsReceived, other.EventsReceived); MergeHashSets(this.EventsSent, other.EventsSent); }