summaryrefslogtreecommitdiffstats
path: root/src/imageutils/testjpegcontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imageutils/testjpegcontent.cpp')
-rw-r--r--src/imageutils/testjpegcontent.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/imageutils/testjpegcontent.cpp b/src/imageutils/testjpegcontent.cpp
index fa9128d..c810506 100644
--- a/src/imageutils/testjpegcontent.cpp
+++ b/src/imageutils/testjpegcontent.cpp
@@ -20,11 +20,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <iostream>
-// Qt
-#include <qdir.h>
-#include <qfile.h>
-#include <qimage.h>
-#include <qstring.h>
+// TQt
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqstring.h>
// KDE
#include <kapplication.h>
@@ -43,8 +43,8 @@ const char* ORIENT6_FILE="orient6.jpg";
const int ORIENT6_WIDTH=128; // This size is the size *after* orientation
const int ORIENT6_HEIGHT=256; // has been applied
const char* CUT_FILE="cut.jpg";
-const QString ORIENT6_COMMENT="a comment";
-const QString ORIENT1_VFLIP_FILE="test_orient1_vflip.jpg";
+const TQString ORIENT6_COMMENT="a comment";
+const TQString ORIENT1_VFLIP_FILE="test_orient1_vflip.jpg";
const char* THUMBNAIL_FILE="test_thumbnail.jpg";
const char* TMP_FILE="tmp.jpg";
@@ -53,18 +53,18 @@ class TestEnvironment {
public:
TestEnvironment() {
bool result;
- QFile in(ORIENT6_FILE);
+ TQFile in(ORIENT6_FILE);
result=in.open(IO_ReadOnly);
Q_ASSERT(result);
- QFileInfo info(in);
+ TQFileInfo info(in);
int size=info.size()/2;
char* data=new char[size];
int readSize=in.readBlock(data, size);
Q_ASSERT(size==readSize);
- QFile out(CUT_FILE);
+ TQFile out(CUT_FILE);
result=out.open(IO_WriteOnly);
Q_ASSERT(result);
@@ -74,17 +74,17 @@ public:
}
~TestEnvironment() {
- QDir::current().remove(CUT_FILE);
+ TQDir::current().remove(CUT_FILE);
}
};
-typedef QMap<QString,QString> MetaInfoMap;
+typedef TQMap<TQString,TQString> MetaInfoMap;
-MetaInfoMap getMetaInfo(const QString& path) {
+MetaInfoMap getMetaInfo(const TQString& path) {
KFileMetaInfo fmi(path);
- QStringList list=fmi.supportedKeys();
- QStringList::ConstIterator it=list.begin();
+ TQStringList list=fmi.supportedKeys();
+ TQStringList::ConstIterator it=list.begin();
MetaInfoMap map;
for ( ; it!=list.end(); ++it) {
@@ -95,16 +95,16 @@ MetaInfoMap getMetaInfo(const QString& path) {
return map;
}
-void compareMetaInfo(const QString& path1, const QString& path2, const QStringList& ignoredKeys) {
+void compareMetaInfo(const TQString& path1, const TQString& path2, const TQStringList& ignoredKeys) {
MetaInfoMap mim1=getMetaInfo(path1);
MetaInfoMap mim2=getMetaInfo(path2);
Q_ASSERT(mim1.keys()==mim2.keys());
- QValueList<QString> keys=mim1.keys();
- QValueList<QString>::ConstIterator it=keys.begin();
+ TQValueList<TQString> keys=mim1.keys();
+ TQValueList<TQString>::ConstIterator it=keys.begin();
for ( ; it!=keys.end(); ++it) {
- QString key=*it;
- if (ignoredKeys.contains(key)) continue;
+ TQString key=*it;
+ if (ignoredKeys.tqcontains(key)) continue;
if (mim1[key]!=mim2[key]) {
kdError() << "Meta info differs. Key:" << key << ", V1:" << mim1[key] << ", V2:" << mim2[key] << endl;
@@ -154,7 +154,7 @@ void testResetOrientation() {
*/
void testTransform() {
bool result;
- QImage finalImage, expectedImage;
+ TQImage finalImage, expectedImage;
ImageUtils::JPEGContent content;
result = content.load(ORIENT6_FILE);
@@ -181,7 +181,7 @@ void testTransform() {
void testSetComment() {
- QString comment = "test comment";
+ TQString comment = "test comment";
ImageUtils::JPEGContent content;
bool result;
result = content.load(ORIENT6_FILE);
@@ -211,10 +211,10 @@ int main(int argc, char* argv[]) {
Q_ASSERT(result);
Q_ASSERT(content.orientation() == 6);
Q_ASSERT(content.comment() == ORIENT6_COMMENT);
- Q_ASSERT(content.size() == QSize(ORIENT6_WIDTH, ORIENT6_HEIGHT));
+ Q_ASSERT(content.size() == TQSize(ORIENT6_WIDTH, ORIENT6_HEIGHT));
// thumbnail()
- QImage thumbnail=content.thumbnail();
+ TQImage thumbnail=content.thumbnail();
result=thumbnail.save(THUMBNAIL_FILE, "JPEG");
Q_ASSERT(result);
@@ -236,12 +236,12 @@ int main(int argc, char* argv[]) {
result = content.load(TMP_FILE);
Q_ASSERT(result);
- Q_ASSERT(content.size() == QSize(ORIENT6_HEIGHT, ORIENT6_WIDTH));
+ Q_ASSERT(content.size() == TQSize(ORIENT6_HEIGHT, ORIENT6_WIDTH));
// Check the other meta info are still here
- QStringList ignoredKeys;
- ignoredKeys << "Orientation" << "Comment";
+ TQStringList ignoredKeys;
+ ignoredKeys << "Qt::Orientation" << "Comment";
compareMetaInfo(ORIENT6_FILE, ORIENT1_VFLIP_FILE, ignoredKeys);
// Test that loading and manipulating a truncated file does not crash