Commit faf55907 authored by Michael Büsch's avatar Michael Büsch

coverage: Add more coverage annotations

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 478930ad
......@@ -67,12 +67,16 @@ try:
cov.exclude(r"raise RuntimeError")
cov.exclude(r"pass\s*#\s*TODO")
cov.exclude(r'raise AwlSimError\("Assertion failed"\)')
cov.exclude(r'except UnicodeError')
cov.exclude(r'if isPyPy')
cov.exclude(r'if isJython')
cov.exclude(r'if isIronPython')
cov.exclude(r'if isCython')
cov.exclude(r'if isMicroPython')
cov.exclude(r'if isWinStandalone')
cov.exclude(r'XmlFactory\.parser_beginTag\(self, tag\)')
cov.exclude(r'XmlFactory\.parser_endTag\(self, tag\)')
cov.exclude(r'XmlFactory\.parser_data\(self, data\)')
# Combine all data files
cov.combine(data_paths=dataPaths, strict=True)
......
......@@ -229,13 +229,13 @@ class AwlInsnTranslator(object):
if insnType is None or\
(insnType >= AwlInsnTypes.TYPE_EXTENDED and\
not extendedInsnsEnabled):
raise KeyError
raise KeyError #@nocov
insnClass = cls.type2class[insnType]
except KeyError:
except KeyError: #@nocov
raise AwlSimError("Cannot translate instruction: '%s'" %\
rawInsn.getName())
insn = insnClass(cpu, rawInsn)
if not extendedInsnsEnabled and\
any(op.isExtended for op in insn.ops):
raise AwlSimError("Extended operands disabled")
raise AwlSimError("Extended operands disabled") #@nocov
return insn
......@@ -59,7 +59,7 @@ class RawAwlInsn(object):
self.name = None
self.ops = []
def __repr__(self):
def __repr__(self): #@nocov
ret = []
if self.hasLabel():
ret.append(self.getLabel() + ': ')
......@@ -224,7 +224,7 @@ class RawAwlDataInit(object):
def getIdentString(self):
return ".".join(str(ident) for ident in self.identChain)
def __repr__(self):
def __repr__(self): #@nocov
return self.getIdentString() + " := " + str(self.valueTokens)
class RawAwlDataField(object):
......@@ -275,7 +275,8 @@ class RawAwlDataField(object):
return field.getChild(identChain[1:])
return field
return None
def __repr__(self):
def __repr__(self): #@nocov
return self.getIdentString()
class RawAwlDB(RawAwlBlock):
......
......@@ -75,7 +75,7 @@ class BlockInfo(object):
def __ne__(self, other):
return not self.__eq__(other)
def __repr__(self):
def __repr__(self): #@nocov
return "BlockInfo(%d, %d, '%s')" % (
self.blockType,
self.blockIndex,
......
......@@ -57,7 +57,7 @@ class _MONOTONIC_RAW_factory(object): #+cdef
b = self.monotonic_raw()
if b - a <= 0.0 or b - a > 1.0:
raise RuntimeError
except Exception as e:
except Exception as e: #@nocov
return False
return True
......@@ -68,12 +68,12 @@ class _MONOTONIC_RAW_timemodule_factory(_MONOTONIC_RAW_factory): #+cdef
def probe(self):
if not hasattr(time, "clock_gettime") or\
not hasattr(time, "CLOCK_MONOTONIC_RAW"):
return False
return False #@nocov
self.__clock_gettime = time.clock_gettime
self.__id_CLOCK_MONOTONIC_RAW = time.CLOCK_MONOTONIC_RAW
if not self._sanityCheck():
if not self._sanityCheck(): #@nocov
printWarning("CLOCK_MONOTONIC_RAW (time module) does not work "
"correctly on this system. Falling "
"back to an alternative.")
......@@ -180,6 +180,6 @@ def monotonic_time(): #@nocy
try:
t = _prevMonotonicTime = _monotonicTimeHandler()
except Exception as e:
except Exception as e: #@nocov
t = _prevMonotonicTime
return t
......@@ -36,9 +36,9 @@ __all__ = [
]
if hasattr(socket, "AF_UNIX"):
if hasattr(socket, "AF_UNIX"): #@nocov
AF_UNIX = socket.AF_UNIX
else:
else: #@nocov
AF_UNIX = None
SocketErrors = (socket.error if hasattr(socket, "error") else OSError,
......
......@@ -413,7 +413,7 @@ class ProjectFactory(XmlFactory):
else:
if tag.name == "awlsim_project":
version = tag.getAttrInt("format_version")
if version != self.FILE_FORMAT_VERSION:
if version != self.FILE_FORMAT_VERSION: #@nocov
raise self.Error("Unsupported .awlpro format version. "
"Got %d, but expected %d." % (
version, self.FILE_FORMAT_VERSION))
......@@ -424,14 +424,14 @@ class ProjectFactory(XmlFactory):
createDate = datetime.datetime.strptime(
createDate, project.DATETIME_FMT)
project.setCreateDate(createDate)
except (ValueError, TypeError) as e:
except (ValueError, TypeError) as e: #@nocov
pass
try:
if modifyDate:
modifyDate = datetime.datetime.strptime(
modifyDate, project.DATETIME_FMT)
project.setModifyDate(modifyDate)
except (ValueError, TypeError) as e:
except (ValueError, TypeError) as e: #@nocov
pass
self.inProject = True
return
......@@ -1052,7 +1052,7 @@ class Project(object):
for symSrc in self.symTabSources:
symSrc.writeFileBacking(compatReEncode=True)
def __repr__(self):
def __repr__(self): #@nocov
if self.projectFile:
return 'Project("%s")' % self.projectFile
return "Project(None)"
......@@ -32,10 +32,10 @@ from awlsim.common.exceptions import *
from awlsim.library.libselection import *
if isPy2Compat:
if isPy2Compat: #@nocov
from ConfigParser import SafeConfigParser as _ConfigParser
from ConfigParser import Error as _ConfigParserError
else:
else: #@nocov
from configparser import ConfigParser as _ConfigParser
from configparser import Error as _ConfigParserError
......@@ -73,9 +73,9 @@ class LegacyProjectParser(object):
try:
p = _ConfigParser()
textIO = StringIO(text)
if hasattr(p, "read_file"):
if hasattr(p, "read_file"): #@nocov
p.read_file(textIO, projectFile)
else:
else: #@nocov
p.readfp(textIO, projectFile)
# AWLSIM_PROJECT section
......
......@@ -125,7 +125,7 @@ class ObjRef(object):
"""
return self.__manager is not None
def __repr__(self):
def __repr__(self): #@nocov
return str(self.name)
class ObjRefManager(object):
......@@ -203,5 +203,5 @@ class ObjRefManager(object):
if self.__allDestroyedCallback:
self.__allDestroyedCallback()
def __repr__(self):
def __repr__(self): #@nocov
return str(self.name)
......@@ -21,7 +21,7 @@ VERSION_EXTRA = "-pre"
if osIsWindows and VERSION_EXTRA:
if osIsWindows and VERSION_EXTRA: #@nocov
# pywin32 does not like non-numbers in the version string.
# Convert the VERSION_EXTRA into a dot-number string.
VERSION_EXTRA = ".0000%d0000" % (crc32(VERSION_EXTRA.encode("UTF-8")) & 0xFFFF)
......
......@@ -235,17 +235,17 @@ class XmlFactory(object):
def parser_close(self):
pass
def parser_beginTag(self, tag):
def parser_beginTag(self, tag): #@nocov
printWarning("[XML-parser - %s] Unhandled tag: <%s>" % (
type(self).__name__, tag.name))
def parser_endTag(self, tag):
def parser_endTag(self, tag): #@nocov
printWarning("[XML-parser - %s] Unhandled tag: </%s>" % (
type(self).__name__, tag.name))
def parser_data(self, data):
data = data.strip()
if data:
if data: #@nocov
printWarning("[XML-parser - %s] Unhandled data: %s" % (
type(self).__name__, data))
......@@ -351,7 +351,7 @@ class XmlFactory(object):
def parse(self, xmlText):
if not xmlText.decode(self.XML_ENCODING).strip():
return False
return False #@nocov
try:
builder = _XmlFactoryBuilder(self)
parser = xml.etree.ElementTree.XMLParser(target=builder)
......
......@@ -283,7 +283,7 @@ class CallStackElem(object): #+cdef
# Call the operator translation handler (Python)
try: #@nocy
trans = self._FC_paramTrans[oper.operType] #@nocy
except KeyError as e: #@nocy
except KeyError as e: #@nocy #@nocov
self._FCTransBug(param, oper) #@nocy
return trans(self, param, oper) #@nocy
......@@ -378,7 +378,7 @@ class CallStackElem(object): #+cdef
#@cy oper = None
#@cy return oper
def _FCTransError(self, param, oper):
def _FCTransError(self, param, oper): #@nocov
raise AwlSimError("Do not know how to translate "
"FC parameter '%s' for call. The specified "
"actual-parameter is not allowed in this call." % (
......@@ -450,7 +450,7 @@ class CallStackElem(object): #+cdef
# Unlink this call stack element from the previous one.
self.prevCse = None
def __repr__(self):
def __repr__(self): #@nocov
return "CallStackElem of %s" % str(self.block)
#
......@@ -560,7 +560,7 @@ def make_CallStackElem(cpu, #@nocy
# Call the operator translation handler (Python)
try: #@nocy
trans = cse._FC_paramTrans[oper.operType] #@nocy
except KeyError as e: #@nocy
except KeyError as e: #@nocy #@nocov
cse._FCTransError(param, oper) #@nocy
cse._interfRefs[param.interfaceFieldIndex] = trans( #@nocy
cse, param, oper) #@nocy
......
......@@ -529,11 +529,11 @@ class S7CPU(object): #+cdef
if hasattr(os, "sched_setaffinity"):
try:
os.sched_setaffinity(0, affinity)
except (OSError, ValueError) as e:
except (OSError, ValueError) as e: #@nocov
raise AwlSimError("Failed to set host CPU "
"affinity to %s: %s" % (
affinity, str(e)))
else:
else: #@nocov
printError("Cannot set CPU affinity "
"on this version of Python. "
"os.sched_setaffinity is not available.")
......@@ -1125,9 +1125,9 @@ class S7CPU(object): #+cdef
try:
cse = self.callStackTop
if not cse:
return None
return None #@nocov
return cse.insns[cse.ip]
except IndexError as e:
except IndexError as e: #@nocov
return None
def labelIdxToRelJump(self, labelIndex): #@nocy
......@@ -1362,26 +1362,26 @@ class S7CPU(object): #+cdef
def getAccu(self, index): #@nocy
#@cy cdef Accu getAccu(self, uint32_t index):
if index < 1 or index > self.specs.nrAccus:
raise AwlSimError("Invalid ACCU offset")
raise AwlSimError("Invalid ACCU offset") #@nocov
return (self.accu1, self.accu2,
self.accu3, self.accu4)[index - 1]
def getAR(self, index): #@nocy
#@cy cdef Addressregister getAR(self, uint32_t index):
if index < 1 or index > 2:
raise AwlSimError("Invalid AR offset")
raise AwlSimError("Invalid AR offset") #@nocov
return (self.ar1, self.ar2)[index - 1]
def getTimer(self, index): #@nocy
#@cy cdef Timer getTimer(self, uint32_t index):
if index >= len(self.timers):
raise AwlSimError("Fetched invalid timer %d" % index)
raise AwlSimError("Fetched invalid timer %d" % index) #@nocov
return self.timers[index]
def getCounter(self, index): #@nocy
#@cy cdef Counter getCounter(self, uint32_t index):
if index >= len(self.counters):
raise AwlSimError("Fetched invalid counter %d" % index)
raise AwlSimError("Fetched invalid counter %d" % index) #@nocov
return self.counters[index]
def getSpecs(self):
......@@ -1512,7 +1512,7 @@ class S7CPU(object): #+cdef
def fetch(self, operator, allowedWidths): #@nocy
try: #@nocy
fetchMethod = self.__fetchTypeMethods[operator.operType] #@nocy
except KeyError: #@nocy
except KeyError: #@nocy #@nocov
self.__invalidFetch(operator) #@nocy
return fetchMethod(self, operator, allowedWidths) #@nocy
......@@ -1600,7 +1600,7 @@ class S7CPU(object): #+cdef
#@cy return self.__fetchVirtDBR(operator, allowedWidths)
#@cy self.__invalidFetch(operator)
def __invalidFetch(self, operator):
def __invalidFetch(self, operator): #@nocov
raise AwlSimError("Invalid fetch request: %s" % str(operator))
def __fetchWidthError(self, operator, allowedWidths):
......@@ -1917,8 +1917,8 @@ class S7CPU(object): #+cdef
def __fetchNAMED_DBVAR(self, operator, allowedWidths): #@nocy
#@cy cdef object __fetchNAMED_DBVAR(self, AwlOperator operator, uint32_t allowedWidths):
# All legit accesses will have been translated to absolute addressing already
raise AwlSimError("Fully qualified load from DB variable "
"is not supported in this place.")
raise AwlSimError("Fully qualified load from DB variable " #@nocov
"is not supported in this place.") #@nocov
def __fetchINDIRECT(self, operator, allowedWidths): #@nocy
#@cy cdef object __fetchINDIRECT(self, AwlOperator operator, uint32_t allowedWidths):
......@@ -2001,7 +2001,7 @@ class S7CPU(object): #+cdef
def store(self, operator, value, allowedWidths): #@nocy
try: #@nocy
storeMethod = self.__storeTypeMethods[operator.operType] #@nocy
except KeyError: #@nocy
except KeyError: #@nocy #@nocov
self.__invalidStore(operator) #@nocy
storeMethod(self, operator, value, allowedWidths) #@nocy
......@@ -2038,7 +2038,7 @@ class S7CPU(object): #+cdef
#@cy else:
#@cy self.__invalidStore(operator)
def __invalidStore(self, operator):
def __invalidStore(self, operator): #@nocov
raise AwlSimError("Invalid store request: %s" % str(operator))
def __storeWidthError(self, operator, allowedWidths):
......@@ -2187,8 +2187,8 @@ class S7CPU(object): #+cdef
def __storeNAMED_DBVAR(self, operator, value, allowedWidths): #@nocy
#@cy cdef __storeNAMED_DBVAR(self, AwlOperator operator, object value, uint32_t allowedWidths):
# All legit accesses will have been translated to absolute addressing already
raise AwlSimError("Fully qualified store to DB variable "
"is not supported in this place.")
raise AwlSimError("Fully qualified store to DB variable " #@nocov
"is not supported in this place.") #@nocov
def __storeINDIRECT(self, operator, value, allowedWidths): #@nocy
#@cy cdef __storeINDIRECT(self, AwlOperator operator, object value, uint32_t allowedWidths):
......@@ -2227,7 +2227,7 @@ class S7CPU(object): #+cdef
append(line)
line, count, first = [], 0, False
i += 1
except IndexError as e:
except IndexError as e: #@nocov
pass # memArray out of bounds access.
if count:
append(line)
......@@ -2239,7 +2239,7 @@ class S7CPU(object): #+cdef
memory = self.activeLStack.memory
byteOffset = frame.byteOffset
allocBits = frame.allocBits
else:
else: #@nocov
memory, byteOffset, allocBits = None, 0, 0
lines = self.__dumpMem(prefix,
memory,
......@@ -2248,7 +2248,7 @@ class S7CPU(object): #+cdef
lines.extend( [ (" " * len(prefix)) + "--" ] * (4 - len(lines)) )
return lines
def dump(self, withTime=True):
def dump(self, withTime=True): #@nocov
#@cy cdef LStackFrame *frame
callStackTop = self.callStackTop
......@@ -2334,7 +2334,7 @@ class S7CPU(object): #+cdef
return '\n'.join(ret)
@property
def insnPerSecondHR(self):
def insnPerSecondHR(self): #@nocov
"""Get a human readable instructions per seconds string.
"""
insnPerSecond = self.insnPerSecond
......@@ -2349,7 +2349,7 @@ class S7CPU(object): #+cdef
return insnPerSecondStr
@property
def usPerInsnHR(self):
def usPerInsnHR(self): #@nocov
"""Get a human readable microseconds per instructions string.
"""
insnPerSecond = self.insnPerSecond
......@@ -2359,5 +2359,5 @@ class S7CPU(object): #+cdef
usPerInsnStr = "-/-"
return usPerInsnStr
def __repr__(self):
def __repr__(self): #@nocov
return self.dump()
......@@ -114,7 +114,7 @@ class AwlStructField(object): #+cdef
return self.override.getFinalOverride()
return self
def __repr__(self):
def __repr__(self): #@nocov
s = "AwlStructField(\"%s\", P#%s, %s (%d bit), init=%s)" %\
(str(self.name),
str(self.offset),
......@@ -232,7 +232,7 @@ class AwlStruct(object): #+cdef
# Add an UDT.
try:
udt = cpu.udts[dataType.index]
except KeyError:
except KeyError: #@nocov
assert(0) # Should never happen
assert(not initBytes)
# Assign the struct to the UDT data type, if
......@@ -342,7 +342,7 @@ class AwlStruct(object): #+cdef
except KeyError:
raise AwlSimError("Data structure field '%s' not found" % name)
def __repr__(self):
def __repr__(self): #@nocov
return "\n".join(str(field) for field in self.fields)
class AwlStructInstance(object): #+cdef
......
......@@ -129,7 +129,7 @@ class AbstractHardwareInterface(object): #+cdef
def doStartup(self):
"""Actually initialize access to hardware.
Overload this method, if the hardware needs initialization"""
pass
pass #@nocov
def shutdown(self):
"""Shutdown access to the hardware."""
......@@ -140,21 +140,21 @@ class AbstractHardwareInterface(object): #+cdef
def doShutdown(self):
"""Actually shutdown access to hardware.
Overload this method, if the hardware needs initialization"""
pass
pass #@nocov
def readInputs(self): #+cdef
"""Read all hardware input data and store it in the PAE.
The implementation is supposed to put the data directly
into the cpu memory.
Overload this method, if the hardware has inputs."""
pass
pass #@nocov
def writeOutputs(self): #+cdef
"""Write all hardware output data (read from PAA).
The implementation is supposed to read the data directly
from the cpu memory.
Overload this method, if the hardware has outputs."""
pass
pass #@nocov
def directReadInput(self, accessWidth, accessOffset): #@nocy
#@cy cdef bytearray directReadInput(self, uint32_t accessWidth, uint32_t accessOffset):
......@@ -166,7 +166,7 @@ class AbstractHardwareInterface(object): #+cdef
this hardware's range.
Overload this method, if the hardware has inputs and
supports direct peripheral access."""
return bytearray()
return bytearray() #@nocov
def directWriteOutput(self, accessWidth, accessOffset, data): #@nocy
#@cy cdef ExBool_t directWriteOutput(self, uint32_t accessWidth, uint32_t accessOffset, bytearray data) except ExBool_val:
......@@ -179,9 +179,9 @@ class AbstractHardwareInterface(object): #+cdef
hardware's range.
Overload this method, if the hardware has outputs and
supports direct peripheral access."""
return False
return False #@nocov
def __repr__(self):
def __repr__(self): #@nocov
return "HardwareInterface: %s" % self.name
def raiseException(self, errorText):
......
......@@ -348,7 +348,7 @@ class AwlInsn(object): #+cdef
"""Run the instruction.
The default implementation does nothing.
"""
pass
pass #@nocov
def _warnDeprecated(self, moreText=""):
lineNrStr = ""
......@@ -377,7 +377,7 @@ class AwlInsn(object): #+cdef
type2name = AwlInsn.type2name_german
try:
name = type2name[self.insnType]
except KeyError:
except KeyError: #@nocov
name = "<unknown type %d>" % self.insnType
ret.append(name)
if self.ops:
......
......@@ -2,7 +2,7 @@
#
# AWL simulator
#
# Copyright 2012-2017 Michael Buesch <m@bues.ch>
# Copyright 2012-2018 Michael Buesch <m@bues.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -47,12 +47,12 @@ def AwlSim_decorator_profiled(profileLevel):
@functools.wraps(func) #@nocy
def profiled_wrapper(self, *args, **kwargs):
if self._profileLevel >= profileLevel:
self._profileStart()
self._profileStart() #@nocov
try:
func(self, *args, **kwargs)
finally:
if self._profileLevel >= profileLevel:
self._profileStop()
self._profileStop() #@nocov
return profiled_wrapper
return profiled_decorator
......@@ -87,7 +87,7 @@ class AwlSim(object): #+cdef
def getCPU(self):
return self.cpu
def __setProfiler(self, profileLevel):
def __setProfiler(self, profileLevel): #@nocov
self._profileLevel = profileLevel
if self._profileLevel <= 0:
return
......@@ -110,13 +110,13 @@ class AwlSim(object): #+cdef
self.__profiler = self.__profileModule.Profile()
def _profileStart(self):
def _profileStart(self): #@nocov
self.__profiler.enable()
def _profileStop(self):
def _profileStop(self): #@nocov
self.__profiler.disable()
def getProfileStats(self):
def getProfileStats(self): #@nocov
if self._profileLevel <= 0:
return None
......@@ -142,7 +142,7 @@ class AwlSim(object): #+cdef
raise e
else:
# Non-fatal. Just log an error.
printError(str(e))
printError(str(e)) #@nocov
@throwsAwlSimError
def __handleMaintenanceRequest(self, e):
......@@ -158,7 +158,7 @@ class AwlSim(object): #+cdef
self.cpu.startup()
else:
assert(0)
except MaintenanceRequest as e:
except MaintenanceRequest as e: #@nocov
raise AwlSimError("Recursive maintenance request")
@profiled(2)
......@@ -210,7 +210,7 @@ class AwlSim(object): #+cdef
def runCycle(self): #+cpdef
if self._profileLevel >= 1:
self._profileStart()
self._profileStart() #@nocov
try:
if self.__registeredHardwareCount:
......@@ -224,7 +224,7 @@ class AwlSim(object): #+cdef
self.__handleMaintenanceRequest(e)
if self._profileLevel >= 1:
self._profileStop()
self._profileStop() #@nocov
@throwsAwlSimError
def shutdown(self):
......@@ -233,7 +233,7 @@ class AwlSim(object): #+cdef
"""
self.unregisterAllHardware()
ps = self.getProfileStats()
if ps:
if ps: #@nocov
sys.stdout.write("\n\nAwlsim core profile stats "
"(level %d) follow:\n" %\
self._profileLevel)
......@@ -358,5 +358,5 @@ class AwlSim(object): #+cdef
return False
return retOk
def __repr__(self):
def __repr__(self): #@nocov
return str(self.cpu)
......@@ -766,7 +766,7 @@ class AwlMemory(object): #+cdef
def __nonzero__(self): #@cy2
return bool(self.dataBytesLen) #@cy2
def __repr__(self):
def __repr__(self): #@nocov
#@cy cdef list ret
#@cy cdef uint64_t i
......@@ -776,5 +776,5 @@ class AwlMemory(object): #+cdef
ret.append('")')
return "".join(ret)
def __str__(self):
def __str__(self): #@nocov
return self.__repr__()
......@@ -138,7 +138,7 @@ class AwlOperator(object): #+cdef
from awlsim.common.sources import AwlSource
try:
return self.immediateBytes.decode(AwlSource.COMPAT_ENCODING)
except UnicodeError as e:
except UnicodeError as e: #@nocov
raise AwlSimError("Invalid characters in operator (decode).")
@immediateStr.setter
......@@ -146,7 +146,7 @@ class AwlOperator(object): #+cdef
from awlsim.common.sources import AwlSource
try:
self.immediateBytes = bytearray(newStr.encode(AwlSource.COMPAT_ENCODING))
except UnicodeError as e:
except UnicodeError as e: #@nocov
raise AwlSimError("Invalid characters in operator (encode).")
def setInsn(self, newInsn):
......@@ -459,7 +459,7 @@ class AwlOperator(object): #+cdef
return "__UNSPEC"
try:
return self.type2str[self.operType]
except KeyError:
except KeyError: #@nocov
assert(0)
#
......@@ -596,24 +596,24 @@ class AwlIndirectOp(AwlOperator): #+cdef
(self.width, str(directOffset)))
return make_AwlOperator(optype, self.width, directOffset, self.insn)
def __pointerError(self):
def __pointerError(self): #@nocov
# This is a programming error.
# The caller should resolve() the operator first.
raise AwlSimBug("Can not transform indirect operator "
"into a pointer. Resolve it first.")
def makePointer(self):
self.__pointerError()
self.__pointerError() #@nocov
def makePointerValue(self): #@nocy
#@cy cpdef uint32_t makePointerValue(self):
self.__pointerError()
self.__pointerError() #@nocov
def makeDBPointer(self):
self.__pointerError()
self.__pointerError() #@nocov
def makeANYPointer(self, areaShifted=None):
self.__pointerError()
self.__pointerError() #@nocov
def __repr__(self):
return "__INDIRECT" #TODO
......
......@@ -161,7 +161,7 @@ class S7StatusWord(object): #+cdef
def getByBitNumber(self, bitNumber): #@nocy
try: #@nocy
return self.__bitnr2getter[bitNumber](self) #@nocy
except IndexError as e: #@nocy
except IndexError as e: #@nocy #@nocov
raise AwlSimError("Status word bit fetch '%d' " #@nocy
"out of range" % bitNumber) #@nocy
......@@ -263,5 +263,5 @@ class S7StatusWord(object): #+cdef
ret.append("%s:%d" % (name, self.getByBitNumber(i)))
return ' '.join(ret)
def __repr__(self):
def __repr__(self): #@nocov
return self.getString(S7CPUConfig.MNEMONICS_DE)
......@@ -34,7 +34,7 @@ from awlsim.core.util import *
class SFBm1(SFB): #+cdef
name = (-1, "__SFB_NOP", None)
def run(self): #+cpdef
def run(self): #+cpdef #@nocov
#@cy cdef S7StatusWord s
s = self.cpu.statusWord
......
......@@ -34,7 +34,7 @@ from awlsim.core.util import *
class SFCm1(SFC): #+cdef
name = (-1, "__SFC_NOP", None)
def run(self): #+cpdef
def run(self