Commit 233a5cbc authored by Michael Reeves's avatar Michael Reeves

Update ABI in tests fix warnings

parent 3e6a121e
Pipeline #13167 passed with stage
in 8 minutes and 22 seconds
......@@ -15,7 +15,7 @@
#define i18n(s) s
bool verbose = false;
Options *m_pOptions = NULL;
QSharedPointer<Options> m_pOptions;
ManualDiffHelpList m_manualDiffHelpList;
bool g_bIgnoreWhiteSpace = true;
......@@ -32,7 +32,7 @@ void printDiffList(const QString caption, const DiffList &diffList)
for(i = diffList.begin(); i != diffList.end(); i++)
{
out << " " << i->nofEquals << "," << i->diff1 << "," << i->diff2 << endl;
out << " " << i->numberOfEquals() << "," << i->diff1() << "," << i->diff2() << endl;
}
}
......@@ -56,8 +56,8 @@ void printDiff3List(const Diff3LineList &diff3LineList,
if(d3l.getLineA().isValid())
{
const LineData *pLineData = &sd1.getLineDataForDiff()[d3l.getLineA()];
lineAText = QString(pLineData->getLine(), pLineData->size());
const LineData *pLineData = &sd1.getLineDataForDiff()->at(d3l.getLineA());
lineAText = pLineData->getLine();
lineAText.replace(QString("\r"), QString("\\r"));
lineAText.replace(QString("\n"), QString("\\n"));
lineAText = QString("%1 %2").arg(d3l.getLineA(), linenumsize).arg(lineAText.left(columnsize - linenumsize - 1));
......@@ -65,8 +65,8 @@ void printDiff3List(const Diff3LineList &diff3LineList,
if(d3l.getLineB().isValid())
{
const LineData *pLineData = &sd2.getLineDataForDiff()[d3l.getLineB()];
lineBText = QString(pLineData->getLine(), pLineData->size());
const LineData *pLineData = &sd2.getLineDataForDiff()->at(d3l.getLineB());
lineBText = pLineData->getLine();
lineBText.replace(QString("\r"), QString("\\r"));
lineBText.replace(QString("\n"), QString("\\n"));
lineBText = QString("%1 %2").arg(d3l.getLineB(), linenumsize).arg(lineBText.left(columnsize - linenumsize - 1));
......@@ -74,8 +74,8 @@ void printDiff3List(const Diff3LineList &diff3LineList,
if(d3l.getLineC().isValid())
{
const LineData *pLineData = &sd3.getLineDataForDiff()[d3l.getLineC()];
lineCText = QString(pLineData->getLine(), pLineData->size());
const LineData *pLineData = &sd3.getLineDataForDiff()->at(d3l.getLineC());
lineCText = pLineData->getLine();
lineCText.replace(QString("\r"), QString("\\r"));
lineCText.replace(QString("\n"), QString("\\n"));
lineCText = QString("%1 %2").arg(d3l.getLineC(), linenumsize).arg(lineCText.left(columnsize - linenumsize - 1));
......@@ -118,8 +118,8 @@ void determineFileAlignment(SourceData &m_sd1, SourceData &m_sd2, SourceData &m_
{
m_manualDiffHelpList.runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,A,B,
m_pOptions);
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
m_diff3LineList.calcDiff3LineListUsingAB( &m_diffList12);
m_diff3LineList.fineDiff(A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
}
else
{
......@@ -134,36 +134,36 @@ void determineFileAlignment(SourceData &m_sd1, SourceData &m_sd2, SourceData &m_
printDiffList("m_diffList13", m_diffList13);
}
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
m_diff3LineList.calcDiff3LineListUsingAB( &m_diffList12);
if (verbose) printDiff3List("after calcDiff3LineListUsingAB", m_diff3LineList, m_sd1, m_sd2, m_sd3);
calcDiff3LineListUsingAC( &m_diffList13, m_diff3LineList );
m_diff3LineList.calcDiff3LineListUsingAC( &m_diffList13);
if (verbose) printDiff3List("after calcDiff3LineListUsingAC", m_diff3LineList, m_sd1, m_sd2, m_sd3);
correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList );
calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
m_diff3LineList.correctManualDiffAlignment(&m_manualDiffHelpList );
m_diff3LineList.calcDiff3LineListTrim(m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
if (verbose) printDiff3List("after 1st calcDiff3LineListTrim", m_diff3LineList, m_sd1, m_sd2, m_sd3);
if ( m_pOptions->m_bDiff3AlignBC )
{
calcDiff3LineListUsingBC( &m_diffList23, m_diff3LineList );
m_diff3LineList.calcDiff3LineListUsingBC( &m_diffList23);
if (verbose) printDiff3List("after calcDiff3LineListUsingBC", m_diff3LineList, m_sd1, m_sd2, m_sd3);
correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList );
calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
m_diff3LineList.correctManualDiffAlignment( &m_manualDiffHelpList );
m_diff3LineList.calcDiff3LineListTrim(m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
if (verbose) printDiff3List("after 2nd calcDiff3LineListTrim", m_diff3LineList, m_sd1, m_sd2, m_sd3);
}
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay() );
fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay() );
m_diff3LineList.fineDiff(A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
m_diff3LineList.fineDiff(B, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay() );
m_diff3LineList.fineDiff(C, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay() );
}
m_diff3LineList.calcWhiteDiff3Lines( m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff() );
}
QString getLineFromSourceData(const SourceData &sd, int line)
{
const LineData *pLineData = &sd.getLineDataForDiff()[line];
QString lineText = QString(pLineData->getLine(), pLineData->size());
const LineData *pLineData = &sd.getLineDataForDiff()->at(line);
QString lineText = pLineData->getLine();
lineText.replace(QString("\r"), QString("\\r"));
lineText.replace(QString("\n"), QString("\\n"));
return lineText;
......@@ -251,16 +251,14 @@ bool dataIsConsistent(int line1, QString &line1Text, int line2, QString &line2Te
bool runTest(QString file1, QString file2, QString file3, QString expectedResultFile, QString actualResultFile, int maxLength)
{
Options options;
m_pOptions = QSharedPointer<Options>::create();
Diff3LineList actualDiff3LineList, expectedDiff3LineList;
QTextCodec *p_codec = QTextCodec::codecForName("UTF-8");
QTextStream out(stdout);
options.m_bIgnoreCase = false;
options.m_bPreserveCarriageReturn = false;
options.m_bDiff3AlignBC = true;
m_pOptions = &options;
m_pOptions->m_bIgnoreCase = false;
m_pOptions->m_bPreserveCarriageReturn = false;
m_pOptions->m_bDiff3AlignBC = true;
SourceData m_sd1, m_sd2, m_sd3;
......@@ -274,15 +272,15 @@ bool runTest(QString file1, QString file2, QString file3, QString expectedResult
}
out.flush();
m_sd1.setOptions(&options);
m_sd1.setOptions(m_pOptions);
m_sd1.setFilename(file1);
m_sd1.readAndPreprocess(p_codec, false);
m_sd2.setOptions(&options);
m_sd2.setOptions(m_pOptions);
m_sd2.setFilename(file2);
m_sd2.readAndPreprocess(p_codec, false);
m_sd3.setOptions(&options);
m_sd3.setOptions(m_pOptions);
m_sd3.setFilename(file3);
m_sd3.readAndPreprocess(p_codec, false);
......
#include <assert.h>
#include "fileaccess.h"
#include <QString>
FileAccess::FileAccess()
{
}
FileAccess::FileAccess(const QString& name, bool bWantToWrite)
{
assert(!bWantToWrite);
Q_ASSERT(!bWantToWrite);
m_name = name;
}
......@@ -29,16 +30,16 @@ bool FileAccess::isValid() const
// bool isSymLink() const;
bool FileAccess::exists() const
{
return true;
}
qint64 FileAccess::size() const
{
return 64;
}
qint64 FileAccess::sizeForReading()
{
return 64;
}
// bool isReadable() const;
......@@ -55,7 +56,7 @@ qint64 FileAccess::sizeForReading()
// QString filePath() const; // The path-string that was used during construction
QString FileAccess::prettyAbsPath() const
{
return QString("");
}
// KUrl url() const;
QString FileAccess::absoluteFilePath() const
......@@ -68,13 +69,17 @@ bool FileAccess::isLocal() const
return true;
}
bool FileAccess::readFile(void* pDestBuffer, unsigned long maxLength )
bool FileAccess::readFile(void* pDestBuffer, qint64 maxLength )
{
Q_UNUSED(pDestBuffer)
Q_UNUSED(maxLength);
return true;
}
bool FileAccess::writeFile(const void* pSrcBuffer, unsigned long length )
bool FileAccess::writeFile(const void* pSrcBuffer, qint64 length )
{
Q_UNUSED(pSrcBuffer);
Q_UNUSED(length);
return true;
}
// bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden,
......@@ -82,26 +87,18 @@ bool FileAccess::writeFile(const void* pSrcBuffer, unsigned long length )
// const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore );
bool FileAccess::copyFile( const QString& destUrl )
{
Q_UNUSED(destUrl);
return true;
}
// bool createBackup( const QString& bakExtension );
//
QString FileAccess::tempFileName()
{
}
bool FileAccess::removeTempFile( const QString& )
QString FileAccess::getTempName() const
{
return QString("");
}
/*bool FileAccess::removeFile()
{
}*/
bool FileAccess::removeFile( const QString& )
bool FileAccess::removeFile()
{
return true;
}
......@@ -28,35 +28,35 @@ ProgressProxy::~ProgressProxy()
void ProgressProxy::setInformation( const QString& info, bool bRedrawUpdate )
{
/* Suppress warning about unused parameters */
(void)info;
(void)bRedrawUpdate;
Q_UNUSED(info);
Q_UNUSED(bRedrawUpdate);
}
void ProgressProxy::setInformation( const QString& info, int current, bool bRedrawUpdate )
{
/* Suppress warning about unused parameters */
(void)info;
(void)current;
(void)bRedrawUpdate;
Q_UNUSED(info);
Q_UNUSED(current);
Q_UNUSED(bRedrawUpdate);
}
void ProgressProxy::setCurrent( qint64 current, bool bRedrawUpdate )
{
/* Suppress warning about unused parameters */
(void)current;
(void)bRedrawUpdate;
Q_UNUSED(current);
Q_UNUSED(bRedrawUpdate);
}
void ProgressProxy::step( bool bRedrawUpdate )
{
/* Suppress warning about unused parameters */
(void)bRedrawUpdate;
Q_UNUSED(bRedrawUpdate);
}
void ProgressProxy::setMaxNofSteps( qint64 dMaxNofSteps )
{
/* Suppress warning about unused parameters */
(void)dMaxNofSteps;
Q_UNUSED(dMaxNofSteps);
}
......@@ -69,8 +69,8 @@ bool ProgressProxy::wasCancelled()
void ProgressProxy::enterEventLoop( KJob* pJob, const QString& jobInfo )
{
/* Suppress warning about unused parameters */
(void)pJob;
(void)jobInfo;
Q_UNUSED(pJob);
Q_UNUSED(jobInfo);
}
void ProgressProxy::exitEventLoop()
......@@ -80,7 +80,7 @@ void ProgressProxy::exitEventLoop()
void ProgressDialog::recalc(bool bUpdate)
{
/* Suppress warning about unused parameters */
(void)bUpdate;
Q_UNUSED(bUpdate);
}
QDialog *ProgressProxy::getDialog()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment