summaryrefslogtreecommitdiffstats
path: root/src/piklab-test/base
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/piklab-test/base
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz
piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip
TQt4 port piklab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/piklab-test/base')
-rw-r--r--src/piklab-test/base/device_test.cpp2
-rw-r--r--src/piklab-test/base/device_test.h2
-rw-r--r--src/piklab-test/base/generator_check.cpp54
-rw-r--r--src/piklab-test/base/generator_check.h6
-rw-r--r--src/piklab-test/base/main_test.cpp2
-rw-r--r--src/piklab-test/base/main_test.h4
6 files changed, 35 insertions, 35 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() {}