예제 #1
0
        internal void AddResult(Mono.Cecil.Cil.SequencePoint sequencePoint, MutantMetaData mutantMetaData, bool mutantKilled)
        {
            if (sequencePoint == null || sequencePoint.Document == null)
            {
                return;
            }
            _mutantsCount++;
            _mutantsKilledCount += (mutantKilled ? 1 : 0);
            string sourceFileUrl = sequencePoint.Document.Url;

            _readerWriterLock.EnterUpgradeableReadLock();
            try
            {
                if (SourceFiles.All(s => s.Url != sourceFileUrl))
                {
                    _readerWriterLock.EnterWriteLock();
                    var newSourceFile = new SourceFile();
                    newSourceFile.SetUrl(sourceFileUrl);
                    SourceFiles.Add(newSourceFile);
                    _readerWriterLock.ExitWriteLock();
                }
            }
            finally
            {
                _readerWriterLock.ExitUpgradeableReadLock();
            }
            var sourceFile = SourceFiles.First(s => s.Url == sourceFileUrl);

            sourceFile.AddResult(sequencePoint, mutantMetaData, mutantKilled);
        }
예제 #2
0
 internal void AddSequencePoint(Mono.Cecil.Cil.SequencePoint point)
 {
     if (SequencePoints.All(s => s.GetIdentifier() != SequencePoint.GetIdentifier(point)))
     {
         SequencePoints.Add(new SequencePoint(point));
     }
 }
예제 #3
0
        internal void AddResult(Mono.Cecil.Cil.SequencePoint sequencePoint, MutantMetaData mutantMetaData, bool mutantKilled)
        {
            string identifier = SequencePoint.GetIdentifier(sequencePoint);

            _readerWriterLock.EnterUpgradeableReadLock();
            try
            {
                if (SequencePoints.All(s => s.GetIdentifier() != identifier))
                {
                    _readerWriterLock.EnterWriteLock();
                    SequencePoints.Add(new SequencePoint(sequencePoint));
                    _readerWriterLock.ExitWriteLock();
                }
            }
            finally
            {
                _readerWriterLock.ExitUpgradeableReadLock();
            }
            var sourceSequencePoint = SequencePoints.First(s => s.GetIdentifier() == identifier);

            sourceSequencePoint.AddResult(mutantMetaData, mutantKilled);
        }
예제 #4
0
 bool IsSequenceValid(Mono.Cecil.Cil.SequencePoint sp)
 {
     return(sp.StartLine != sp.EndLine || sp.StartColumn != sp.EndColumn);
 }
예제 #5
0
 public InstructionSymbol(int offset, Mono.Cecil.Cil.SequencePoint sequencePoint)
 {
     this.Offset        = offset;
     this.SequencePoint = sequencePoint;
 }