diff options
Diffstat (limited to 'src/piklab-test')
-rw-r--r-- | src/piklab-test/base/generator_check.cpp | 22 | ||||
-rw-r--r-- | src/piklab-test/checksum/checksum_check.cpp | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/src/piklab-test/base/generator_check.cpp b/src/piklab-test/base/generator_check.cpp index f7ce96f..1df1a9c 100644 --- a/src/piklab-test/base/generator_check.cpp +++ b/src/piklab-test/base/generator_check.cpp @@ -130,10 +130,10 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) for (uint i=0; i<config._words.count(); i++) { const Pic::Config::Word &cword = config._words[i]; for (uint k=0; k<cword.masks.count(); k++) { - const Pic::Config::Mask &ctqmask = cword.masks[k]; - if ( l<ctqmask.values.count() ) { + const Pic::Config::Mask &cmask = cword.masks[k]; + if ( l<cmask.values.count() ) { ok = true; - if ( !ctqmask.values[l].name.isEmpty() ) _memory2->setConfigValue(ctqmask.name, ctqmask.values[l].name); + if ( !cmask.values[l].name.isEmpty() ) _memory2->setConfigValue(cmask.name, cmask.values[l].name); } } } @@ -158,22 +158,22 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) BitValue word2 = _memory2->word(Pic::MemoryRangeType::Config, i); if ( word1==word2 ) continue; for (uint k=0; k<cword.masks.count(); k++) { - const Pic::Config::Mask &ctqmask = cword.masks[k]; - if ( ctqmask.value.isInside(cword.ptqmask) ) continue; - BitValue value1 = word1.maskWith(ctqmask.value); - BitValue value2 = word2.maskWith(ctqmask.value); + const Pic::Config::Mask &cmask = cword.masks[k]; + if ( cmask.value.isInside(cword.pmask) ) continue; + BitValue value1 = word1.maskWith(cmask.value); + BitValue value2 = word2.maskWith(cmask.value); if ( value1==value2 ) continue; TQString name1, name2; uint l1, l2; - for (uint l=0; l<ctqmask.values.count(); l++) { - const Pic::Config::Value &value = ctqmask.values[l]; + for (uint l=0; l<cmask.values.count(); l++) { + const Pic::Config::Value &value = cmask.values[l]; if ( value.value==value1 ) { name1 = value.name; l1 = l; } if ( value.value==value2 ) { name2 = value.name; l2 = l; } } if ( name1==name2 ) continue; TEST_FAILED_RETURN(TQString("Config bits are different in %1: set\"%2\"=(%3) != compiled=%4)") - .tqarg(ctqmask.name).tqarg(ctqmask.values[l2].name) - .tqarg(toHexLabel(word2.maskWith(ctqmask.value), nbChars)).tqarg(toHexLabel(word1.maskWith(ctqmask.value), nbChars))) + .tqarg(cmask.name).tqarg(cmask.values[l2].name) + .tqarg(toHexLabel(word2.maskWith(cmask.value), nbChars)).tqarg(toHexLabel(word1.maskWith(cmask.value), nbChars))) } } } diff --git a/src/piklab-test/checksum/checksum_check.cpp b/src/piklab-test/checksum/checksum_check.cpp index 031688b..47873ab 100644 --- a/src/piklab-test/checksum/checksum_check.cpp +++ b/src/piklab-test/checksum/checksum_check.cpp @@ -36,11 +36,11 @@ void ChecksumCheck::setProtection(const Pic::Data &data, const Pic::Checksum::Da if ( !valueName.isEmpty() ) _memory->setUserIdToUnprotectedChecksum(); for (uint i=0; i<cdata.protectedMaskNames.count(); i++) { TQString pmName = cdata.protectedMaskNames[i]; - const Pic::Config::Mask *tqmask = data.config().findMask(pmName, 0); - for (int k=tqmask->values.count()-1; k>=0; k--) { - if ( tqmask->values[k].name.isEmpty() ) continue; - if ( protection.isNoneProtectedValueName(tqmask->values[k].name) ) continue; - _memory->setConfigValue(pmName, tqmask->values[k].name); + const Pic::Config::Mask *mask = data.config().findMask(pmName, 0); + for (int k=mask->values.count()-1; k>=0; k--) { + if ( mask->values[k].name.isEmpty() ) continue; + if ( protection.isNoneProtectedValueName(mask->values[k].name) ) continue; + _memory->setConfigValue(pmName, mask->values[k].name); break; } } @@ -57,8 +57,8 @@ bool ChecksumCheck::checkChecksum(BitValue checksum, const TQString &label) void ChecksumCheck::checkChecksum(const Pic::Data &pdata, const TQString &maskName, const TQString &valueName, bool &ok) { if ( !pdata.checksums().contains(valueName) ) { - const Pic::Config::Mask *tqmask = pdata.config().findMask(maskName); - TQString label = valueName + (tqmask ? "/" + tqmask->name : TQString()); + const Pic::Config::Mask *mask = pdata.config().findMask(maskName); + TQString label = valueName + (mask ? "/" + mask->name : TQString()); printf("Missing checksum for \"%s\"", label.latin1()); return; } @@ -84,10 +84,10 @@ bool ChecksumCheck::execute(const Device::Data &data) break; case Pic::Protection::BasicProtection: { TQString maskName = protection.maskName(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code); - const Pic::Config::Mask *tqmask = pdata.config().findMask(maskName); - Q_ASSERT(tqmask); - for (uint i=0; i<tqmask->values.count(); i++) { - TQString valueName = tqmask->values[i].name; + const Pic::Config::Mask *mask = pdata.config().findMask(maskName); + Q_ASSERT(mask); + for (uint i=0; i<mask->values.count(); i++) { + TQString valueName = mask->values[i].name; if ( valueName.isEmpty() ) continue; // invalid value checkChecksum(pdata, maskName, valueName, ok); } |