diff options
Diffstat (limited to 'src/piklab-test')
-rw-r--r-- | src/piklab-test/base/device_test.cpp | 2 | ||||
-rw-r--r-- | src/piklab-test/base/device_test.h | 2 | ||||
-rw-r--r-- | src/piklab-test/base/generator_check.cpp | 54 | ||||
-rw-r--r-- | src/piklab-test/base/generator_check.h | 6 | ||||
-rw-r--r-- | src/piklab-test/base/main_test.cpp | 2 | ||||
-rw-r--r-- | src/piklab-test/base/main_test.h | 4 | ||||
-rw-r--r-- | src/piklab-test/checksum/checksum_check.cpp | 56 | ||||
-rw-r--r-- | src/piklab-test/checksum/checksum_check.h | 6 | ||||
-rw-r--r-- | src/piklab-test/misc/misc_check.cpp | 2 | ||||
-rw-r--r-- | src/piklab-test/save_load_memory/save_load_memory_check.cpp | 4 |
10 files changed, 69 insertions, 69 deletions
diff --git a/src/piklab-test/base/device_test.cpp b/src/piklab-test/base/device_test.cpp index 9346a13..07a5fdd 100644 --- a/src/piklab-test/base/device_test.cpp +++ b/src/piklab-test/base/device_test.cpp @@ -14,7 +14,7 @@ void DeviceTest::checkArguments() { if ( _args->count()==1 ) { - _device = QString(_args->arg(0)).upper(); + _device = TQString(_args->arg(0)).upper(); if ( !Device::lister().isSupported(_device) ) qFatal("Specified device \"%s\" not supported.", _device.latin1()); printf("Testing only %s\n", _device.latin1()); } diff --git a/src/piklab-test/base/device_test.h b/src/piklab-test/base/device_test.h index 24447ed..cd96edc 100644 --- a/src/piklab-test/base/device_test.h +++ b/src/piklab-test/base/device_test.h @@ -26,7 +26,7 @@ protected: virtual void checkArguments(); private: - QString _device; + TQString _device; }; #endif diff --git a/src/piklab-test/base/generator_check.cpp b/src/piklab-test/base/generator_check.cpp index 68ad2c5..5819188 100644 --- a/src/piklab-test/base/generator_check.cpp +++ b/src/piklab-test/base/generator_check.cpp @@ -92,21 +92,21 @@ bool GeneratorCheck::execute(const Device::Data &data) // run compiler Process::State state = Process::runSynchronously(*_helper->_cprocess, Process::Start, 2000); // 2s timeout if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running compilation") - if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(QString("Error in compilation for %1:\n%2%3").arg(data.name()).arg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).arg(QString::null)) + if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in compilation for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).tqarg(TQString())) // run linker if (_helper->_lprocess) { state = Process::runSynchronously(*_helper->_lprocess, Process::Start, 2000); // 2s timeout if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running linking") - if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(QString("Error in linking for %1:\n%2%3").arg(data.name()).arg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).arg(QString::null)) + if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in linking for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).tqarg(TQString())) } // load hex file if ( !_fhex->openForRead() ) TEST_FAILED_RETURN("") - QStringList errors, warnings; + TQStringList errors, warnings; Device::Memory::WarningTypes warningTypes; - if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(QString("Error loading hex into memory: %1").arg(errors.join(" "))) - //if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(QString("Warning loading hex into memory: %1").arg(warnings.join(" "))) + if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex into memory: %1").tqarg(errors.join(" "))) + //if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(TQString("Warning loading hex into memory: %1").tqarg(warnings.join(" "))) TEST_PASSED return true; @@ -129,11 +129,11 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) bool ok = false; 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 &cmask = cword.masks[k]; - if ( l<cmask.values.count() ) { + for (uint k=0; k<cword.tqmasks.count(); k++) { + const Pic::Config::Mask &ctqmask = cword.tqmasks[k]; + if ( l<ctqmask.values.count() ) { ok = true; - if ( !cmask.values[l].name.isEmpty() ) _memory2->setConfigValue(cmask.name, cmask.values[l].name); + if ( !ctqmask.values[l].name.isEmpty() ) _memory2->setConfigValue(ctqmask.name, ctqmask.values[l].name); } } } @@ -157,23 +157,23 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) BitValue word1 = _memory1->word(Pic::MemoryRangeType::Config, i); 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 &cmask = cword.masks[k]; - if ( cmask.value.isInside(cword.pmask) ) continue; - BitValue value1 = word1.maskWith(cmask.value); - BitValue value2 = word2.maskWith(cmask.value); + for (uint k=0; k<cword.tqmasks.count(); k++) { + const Pic::Config::Mask &ctqmask = cword.tqmasks[k]; + if ( ctqmask.value.isInside(cword.ptqmask) ) continue; + BitValue value1 = word1.tqmaskWith(ctqmask.value); + BitValue value2 = word2.tqmaskWith(ctqmask.value); if ( value1==value2 ) continue; - QString name1, name2; + TQString name1, name2; uint l1, l2; - for (uint l=0; l<cmask.values.count(); l++) { - const Pic::Config::Value &value = cmask.values[l]; + for (uint l=0; l<ctqmask.values.count(); l++) { + const Pic::Config::Value &value = ctqmask.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(QString("Config bits are different in %1: set\"%2\"=(%3) != compiled=%4)") - .arg(cmask.name).arg(cmask.values[l2].name) - .arg(toHexLabel(word2.maskWith(cmask.value), nbChars)).arg(toHexLabel(word1.maskWith(cmask.value), nbChars))) + 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.tqmaskWith(ctqmask.value), nbChars)).tqarg(toHexLabel(word1.tqmaskWith(ctqmask.value), nbChars))) } } } @@ -198,7 +198,7 @@ bool TemplateGeneratorCheck::init(const Device::Data &data) PURL::ToolType ttype = sfamily.data().toolType; SourceLine::List lines = _helper->generator()->templateSourceFile(ttype, data, ok); _source = SourceLine::text(sfamily, lines, 2); - if (!ok) TEST_FAILED_RETURN(QString("Incomplete template generator for %1").arg(data.name())) + if (!ok) TEST_FAILED_RETURN(TQString("Incomplete template generator for %1").tqarg(data.name())) return true; } @@ -211,7 +211,7 @@ GPUtilsGeneratorCheckHelper::GPUtilsGeneratorCheckHelper() void GPUtilsGeneratorCheckHelper::initSupported() { Process::StringOutput p; - QStringList options; + TQStringList options; options += "-l"; p.setup("gpasm", options, false); Process::runSynchronously(p, Process::Start, 2000); // 2s timeout @@ -221,7 +221,7 @@ void GPUtilsGeneratorCheckHelper::initSupported() bool GPUtilsGeneratorCheckHelper::init(const Device::Data &data) { _cprocess = new Process::StringOutput; - QStringList options; + TQStringList options; options = "-c"; options += "-p" + GPUtils::toDeviceName(data.name()); options += "test.asm"; @@ -257,8 +257,8 @@ void SDCCGeneratorCheckHelper::initSupported() _supported.clear(); for (uint i=0; i<SDCC::Nb_Families; i++) { Process::StringOutput p; - QStringList options; - options += QString("-m") + SDCC::FAMILY_DATA[i].name; + TQStringList options; + options += TQString("-m") + SDCC::FAMILY_DATA[i].name; options += "-phelp"; options += "test.c"; p.setup("sdcc", options, false); @@ -270,8 +270,8 @@ void SDCCGeneratorCheckHelper::initSupported() bool SDCCGeneratorCheckHelper::init(const Device::Data &data) { _cprocess = new Process::StringOutput; - QStringList options; - options += QString("-m") + SDCC::FAMILY_DATA[SDCC::family(data.name())].name; + TQStringList options; + options += TQString("-m") + SDCC::FAMILY_DATA[SDCC::family(data.name())].name; options += "-" + SDCC::toDeviceName(data.name()); options += "test.c"; options += "-I/usr/share/gputils/header"; diff --git a/src/piklab-test/base/generator_check.h b/src/piklab-test/base/generator_check.h index 9ad426a..c7529d0 100644 --- a/src/piklab-test/base/generator_check.h +++ b/src/piklab-test/base/generator_check.h @@ -25,13 +25,13 @@ public: virtual void initSupported() = 0; virtual bool init(const Device::Data &data) = 0; void cleanup(); - bool isSupported(const Device::Data &data) const { return _supported.contains(&data); } + bool isSupported(const Device::Data &data) const { return _supported.tqcontains(&data); } virtual PURL::FileType sourceFileType() const = 0; const Tool::SourceGenerator *generator() const { return _generator; } virtual SourceLine::List configEndLines() const = 0; protected: - QValueList<const Device::Data *> _supported; + TQValueList<const Device::Data *> _supported; Process::StringOutput *_cprocess, *_lprocess; Tool::SourceGenerator *_generator; @@ -54,7 +54,7 @@ protected: CLI::View *_view; PURL::File *_fdest, *_fhex; Pic::Memory *_memory1; - QString _source; + TQString _source; }; //---------------------------------------------------------------------------- diff --git a/src/piklab-test/base/main_test.cpp b/src/piklab-test/base/main_test.cpp index 10d0414..bfacdf8 100644 --- a/src/piklab-test/base/main_test.cpp +++ b/src/piklab-test/base/main_test.cpp @@ -23,7 +23,7 @@ void Test::runTest() printf("RESULTS: %i PASSED / %i FAILED / %i SKIPPED \n", _nbPassed, _nbFailed, _nbSkipped); } -void Test::failed(const QString &message, const char *file, int line) +void Test::failed(const TQString &message, const char *file, int line) { _nbFailed++; printf("\n"); diff --git a/src/piklab-test/base/main_test.h b/src/piklab-test/base/main_test.h index 601b779..4006bd9 100644 --- a/src/piklab-test/base/main_test.h +++ b/src/piklab-test/base/main_test.h @@ -36,10 +36,10 @@ public: protected: KCmdLineArgs *_args; - QString _message; + TQString _message; void passed() { _nbPassed++; } - void failed(const QString &message, const char *file, int line); + void failed(const TQString &message, const char *file, int line); void skipped() { _nbSkipped++; } virtual bool execute() = 0; // returns false if failed or skipped virtual void checkArguments() {} diff --git a/src/piklab-test/checksum/checksum_check.cpp b/src/piklab-test/checksum/checksum_check.cpp index fdba104..86877c0 100644 --- a/src/piklab-test/checksum/checksum_check.cpp +++ b/src/piklab-test/checksum/checksum_check.cpp @@ -29,46 +29,46 @@ void ChecksumCheck::cleanup(const Device::Data &) } void ChecksumCheck::setProtection(const Pic::Data &data, const Pic::Checksum::Data &cdata, - const QString &maskName, const QString &valueName) + const TQString &tqmaskName, const TQString &valueName) { const Pic::Protection &protection = data.config().protection(); - if ( !maskName.isEmpty() && !valueName.isEmpty() ) _memory->setConfigValue(maskName, valueName); + if ( !tqmaskName.isEmpty() && !valueName.isEmpty() ) _memory->setConfigValue(tqmaskName, valueName); if ( !valueName.isEmpty() ) _memory->setUserIdToUnprotectedChecksum(); for (uint i=0; i<cdata.protectedMaskNames.count(); i++) { - QString pmName = cdata.protectedMaskNames[i]; - 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); + 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); break; } } if ( !cdata.bbsize.isEmpty() ) _memory->setConfigValue(protection.bootSizeMaskName(), cdata.bbsize); } -bool ChecksumCheck::checkChecksum(BitValue checksum, const QString &label) +bool ChecksumCheck::checkChecksum(BitValue checksum, const TQString &label) { BitValue c = _memory->checksum(); - if ( c!=checksum ) TEST_FAILED_RETURN(QString("%1 %2/%3").arg(label).arg(toHexLabel(c, 4)).arg(toHexLabel(checksum, 4))) + if ( c!=checksum ) TEST_FAILED_RETURN(TQString("%1 %2/%3").tqarg(label).tqarg(toHexLabel(c, 4)).tqarg(toHexLabel(checksum, 4))) return true; } -void ChecksumCheck::checkChecksum(const Pic::Data &pdata, const QString &maskName, const QString &valueName, bool &ok) +void ChecksumCheck::checkChecksum(const Pic::Data &pdata, const TQString &tqmaskName, const TQString &valueName, bool &ok) { - if ( !pdata.checksums().contains(valueName) ) { - const Pic::Config::Mask *mask = pdata.config().findMask(maskName); - QString label = valueName + (mask ? "/" + mask->name : QString::null); + if ( !pdata.checksums().tqcontains(valueName) ) { + const Pic::Config::Mask *tqmask = pdata.config().findMask(tqmaskName); + TQString label = valueName + (tqmask ? "/" + tqmask->name : TQString()); printf("Missing checksum for \"%s\"", label.latin1()); return; } const Pic::Checksum::Data &cdata = pdata.checksums()[valueName]; _memory->clear(); - setProtection(pdata, cdata, maskName, valueName); - if ( !checkChecksum(cdata.blankChecksum, maskName + ":" + valueName + "/" + "blank") ) ok = false; + setProtection(pdata, cdata, tqmaskName, valueName); + if ( !checkChecksum(cdata.blankChecksum, tqmaskName + ":" + valueName + "/" + "blank") ) ok = false; _memory->checksumCheckFill(); - setProtection(pdata, cdata, maskName, valueName); - if ( !checkChecksum(cdata.checkChecksum, maskName + ":" + valueName + "/" + "check") ) ok = false; + setProtection(pdata, cdata, tqmaskName, valueName); + if ( !checkChecksum(cdata.checkChecksum, tqmaskName + ":" + valueName + "/" + "check") ) ok = false; } bool ChecksumCheck::execute(const Device::Data &data) @@ -80,16 +80,16 @@ bool ChecksumCheck::execute(const Device::Data &data) const Pic::Protection &protection = pdata.config().protection(); switch ( protection.family() ) { case Pic::Protection::NoProtection: - checkChecksum(pdata, QString::null, QString::null, ok); + checkChecksum(pdata, TQString(), TQString(), ok); break; case Pic::Protection::BasicProtection: { - QString maskName = protection.maskName(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code); - const Pic::Config::Mask *mask = pdata.config().findMask(maskName); - Q_ASSERT(mask); - for (uint i=0; i<mask->values.count(); i++) { - QString valueName = mask->values[i].name; + TQString tqmaskName = protection.tqmaskName(Pic::Protection::ProgramProtected, Pic::MemoryRangeType::Code); + const Pic::Config::Mask *tqmask = pdata.config().findMask(tqmaskName); + Q_ASSERT(tqmask); + for (uint i=0; i<tqmask->values.count(); i++) { + TQString valueName = tqmask->values[i].name; if ( valueName.isEmpty() ) continue; // invalid value - checkChecksum(pdata, maskName, valueName, ok); + checkChecksum(pdata, tqmaskName, valueName, ok); } break; } @@ -98,10 +98,10 @@ bool ChecksumCheck::execute(const Device::Data &data) checkChecksum(pdata, "GSSEC", "High Security", ok); break; case Pic::Protection::BlockProtection: { - const QMap<QString, Pic::Checksum::Data> &cmap = pdata.checksums(); - QMap<QString, Pic::Checksum::Data>::const_iterator it; + const TQMap<TQString, Pic::Checksum::Data> &cmap = pdata.checksums(); + TQMap<TQString, Pic::Checksum::Data>::const_iterator it; for (it=cmap.begin(); it!=cmap.end(); ++it) - checkChecksum(pdata, QString::null, it.key(), ok); + checkChecksum(pdata, TQString(), it.key(), ok); break; } case Pic::Protection::Nb_Families: Q_ASSERT(false); break; diff --git a/src/piklab-test/checksum/checksum_check.h b/src/piklab-test/checksum/checksum_check.h index 6483984..e56fd2b 100644 --- a/src/piklab-test/checksum/checksum_check.h +++ b/src/piklab-test/checksum/checksum_check.h @@ -27,9 +27,9 @@ private: Pic::Memory *_memory; void setProtection(const Pic::Data &data, const Pic::Checksum::Data &cdata, - const QString &maskName, const QString &valueName); - bool checkChecksum(BitValue checksum, const QString &label); - void checkChecksum(const Pic::Data &data, const QString &maskName, const QString &valueName, bool &ok); + const TQString &tqmaskName, const TQString &valueName); + bool checkChecksum(BitValue checksum, const TQString &label); + void checkChecksum(const Pic::Data &data, const TQString &tqmaskName, const TQString &valueName, bool &ok); }; #endif diff --git a/src/piklab-test/misc/misc_check.cpp b/src/piklab-test/misc/misc_check.cpp index 3f14287..7f8c710 100644 --- a/src/piklab-test/misc/misc_check.cpp +++ b/src/piklab-test/misc/misc_check.cpp @@ -14,7 +14,7 @@ bool MiscCheck::execute() { { - PURL::Url url = PURL::Url::fromPathOrUrl(QString::null); + PURL::Url url = PURL::Url::fromPathOrUrl(TQString()); if ( !url.isEmpty() ) TEST_FAILED("isEmpty"); TEST_PASSED; } diff --git a/src/piklab-test/save_load_memory/save_load_memory_check.cpp b/src/piklab-test/save_load_memory/save_load_memory_check.cpp index 22eb1ea..e6bb1be 100644 --- a/src/piklab-test/save_load_memory/save_load_memory_check.cpp +++ b/src/piklab-test/save_load_memory/save_load_memory_check.cpp @@ -50,9 +50,9 @@ bool SaveLoadMemoryCheck::execute(const Device::Data &data) // read hex file if ( !_fdest->openForRead() ) TEST_FAILED_RETURN("") - QStringList errors, warnings; + TQStringList errors, warnings; Device::Memory::WarningTypes wtypes; - if ( !_memory2->load(_fdest->stream(), errors, wtypes, warnings) ) TEST_FAILED_RETURN(QString("Error loading hex file into memory %1").arg(data.name())) + if ( !_memory2->load(_fdest->stream(), errors, wtypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex file into memory %1").tqarg(data.name())) // compare checksums if ( _memory1->checksum()!=_memory2->checksum() ) TEST_FAILED_RETURN("Memory saved and loaded is different") |