*-conflict_*
*~
-
+*.pro.user
* You also can use the licence from http://www.wtfpl.net/.
* The original sources can be found on https://github.com/republib.
*/
-#include "rplcore.hpp"
+#include "rplcore/rplcore.hpp"
/** @class RplConfig rplconfig.hpp "rplcore/rplconfig.hpp"
*
if(m_readOnly)
m_logger->log(LOG_ERROR, LOC_WRITE_1, "cannot write: (readonly");
else {
- m_logger->log(LOG_ERROR, LOC_WRITE_2, "not implemented: write()");
+ m_logger->logv(LOG_ERROR, LOC_WRITE_2, "not implemented: write(%s)",
+ file);
}
return rc;
}
m_ixItem(0),
m_ixBag(0),
m_readPosition(NULL) {
+ if (sizeHint > 0)
+ m_data.reserve(sizeHint);
}
/**
nextBag();
QByteArray item;
int maxLength;
- for(int ixItem; ixItem < m_typeList.length(); ixItem++) {
+ for(int ixItem = 0; ixItem < m_typeList.length(); ixItem++) {
type_tag_t currentType = (type_tag_t) m_typeList.at(ixItem);
switch(currentType) {
case TAG_CHAR:
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
+#include <assert.h>
#include <QAbstractSocket>
#include <QTcpSocket>
#include <QMutex>
typedef unsigned char uint8_t;
-#include "../rplmodules.hpp"
-#include "rpllogger.hpp"
-#include "rplexception.hpp"
-#include "rplcontainer.hpp"
-#include "rplstring.hpp"
-#include "rplconfigurator.hpp"
-#include "rplconfig.hpp"
-#include "rplterminator.hpp"
+#include "rplmodules.hpp"
+#include "rplcore/rpllogger.hpp"
+#include "rplcore/rplexception.hpp"
+#include "rplcore/rplcontainer.hpp"
+#include "rplcore/rplstring.hpp"
+#include "rplcore/rplconfigurator.hpp"
+#include "rplcore/rplconfig.hpp"
+#include "rplcore/rplterminator.hpp"
#endif // RPLCORE_HPP
m_message(message) {
if(logger == NULL)
logger = RplLogger::globalLogger();
- logger->log(LOG_ERROR, location, message);
+ logger->log(level, location, message);
}
/**
m_message(message) {
if(logger == NULL)
logger = RplLogger::globalLogger();
- logger->log(LOG_ERROR, location, message);
+ logger->log(level, location, message);
}
/**
m_message = buffer;
if(logger == NULL)
logger = RplLogger::globalLogger();
- logger->log(LOG_ERROR, location, buffer);
+ logger->log(level, location, buffer);
}
/**
m_message = buffer;
if(logger == NULL)
logger = RplLogger::globalLogger();
- logger->log(LOG_ERROR, location, buffer);
+ logger->log(level, location, buffer);
}
return expected == current;
}
+/**
+ * Tests the equality of two values.
+ *
+ * Differences will be logged.
+ *
+ * @param expected the expected value
+ * @param current the current value
+ * @param file the file containing the test
+ * @param lineNo the line number containing the test
+ * @return true: equal
+ */
+bool RplTest::assertEquals(qreal expected, qreal current, const char* file,
+ int lineNo) {
+ if(expected != current)
+ error("%s-%d: error: %d != %d / %x != %x)", file, lineNo, expected, current,
+ (unsigned int) expected, (unsigned int) current);
+ return expected == current;
+}
+
/**
* @brief Tests the equality of two values.
*
RplTest& operator =(const RplTest& source);
public:
bool assertEquals(int expected, int current, const char* file, int lineNo);
+ bool assertEquals(qreal expected, qreal current, const char* file, int lineNo);
bool assertEquals(const char* expected, const char* current,
const char* file, int lineNo);
bool assertEquals(const QByteArray& expected, const QByteArray& current,
* You also can use the licence from http://www.wtfpl.net/.
* The original sources can be found on https://github.com/republib.
*/
-#include "project.hpp"
+include "project.hpp"
#include "rplcore/rpltest.hpp"
// Code to test:
* otherwise: the certificate as byte array
*/
QByteArray RplEnigma::readCertificate(const char* filename) {
- QByteArray rc;
-
+ QByteArray rc = "not implemented: readCertificate(): ";
+ rc += filename;
+ assert(rc.isEmpty());
return rc;
}
#ifndef RPLCORE_HPP
#include "rplcore/rplcore.hpp"
#endif
-#include "rplrandom.hpp"
-#include "rplenigma.hpp"
+#include "rplmath/rplrandom.hpp"
+#include "rplmath/rplenigma.hpp"
+#include "rplmath/rplmatrix.hpp"
#endif // RPLMATH_HPP
/*
- * Matrix.cpp
+ * RplMatrix.cpp
*
* Created on: 29.05.2014
* Author: hm
*/
-#include "matrixall.hpp"
+#include "rplmath/rplmath.hpp"
-namespace rpl {
-
-MatrixException::MatrixException(const Matrix& matrix,
+RplMatrixException::RplMatrixException(int id, const RplMatrix& RplMatrix,
const char* format, ...) :
m_message()
{
- if (! matrix.getName().empty())
- m_message = matrix.getName() + ": ";
+ if (! RplMatrix.getName().empty())
+ m_message = RplMatrix.getName() + ": ";
char buffer[16*1024];
va_list args;
va_end(args);
m_message += buffer;
}
-MatrixException::MatrixException(const char* format, ...)
+RplMatrixException::RplMatrixException(const char* format, ...)
{
char buffer[16*1024];
/**
* Constructor.
*/
-Matrix::Matrix(const char* name) :
+RplMatrix::RplMatrix(const char* name) :
m_rows(0),
m_cols(0),
m_values(NULL),
* @param rows number of rows
* @param cols number of columns
*/
-Matrix::Matrix(int rows, int cols, const char* name):
+RplMatrix::RplMatrix(int rows, int cols, const char* name):
m_rows(rows),
m_cols(cols),
m_values(new MatVal[rows*cols]),
/**
* Destructor.
*/
-Matrix::~Matrix() {
+RplMatrix::~RplMatrix() {
delete m_values;
m_values = NULL;
}
*
* @param source source to copy
*/
-Matrix::Matrix(const Matrix& source) :
+RplMatrix::RplMatrix(const RplMatrix& source) :
m_rows(0),
m_cols(),
m_values(NULL),
*
* @param rows the row number
* @param cols the column number
- * @trows MatrixException
+ * @trows RplMatrixException
*/
-void Matrix::checkDefinition(int rows, int cols) const
+void RplMatrix::checkDefinition(int rows, int cols) const
{
if (rows < 0)
- throw MatrixException(*this, "row number negative: %d", rows);
+ throw RplMatrixException(*this, "row number negative: %d", rows);
if (cols < 0)
- throw MatrixException(*this, "column number negative: %d", cols);
+ throw RplMatrixException(*this, "column number negative: %d", cols);
if (double(rows) * cols > 1.0*1000*1000)
- throw MatrixException(*this, "too many elements: %d*%d", rows, cols);
+ throw RplMatrixException(*this, "too many elements: %d*%d", rows, cols);
}
/**
* Checks the validity of the indexes.
*
- * @param row the matrix row number: 0..N-1
- * @param col the matrix column number: 0..M-1
- * @throws MatrixException
+ * @param row the RplMatrix row number: 0..N-1
+ * @param col the RplMatrix column number: 0..M-1
+ * @throws RplMatrixException
*/
-void Matrix::check(int row, int col) const
+void RplMatrix::check(int row, int col) const
{
if (row < 0 || row >= m_rows)
- throw MatrixException(*this, "invalid row: %d not in [0,%d[", row,
+ throw RplMatrixException(*this, "invalid row: %d not in [0,%d[", row,
m_rows);
if (col < 0 || col >= m_cols)
- throw MatrixException(*this, "invalid column: %d not in [0,%d[", col,
+ throw RplMatrixException(*this, "invalid column: %d not in [0,%d[", col,
m_cols);
}
/**
- * Checks whether a given matrix has the same dimensions.
+ * Checks whether a given Matrix has the same dimensions.
*
- * @param operand matrix to compare
- * @throws MatrixException
+ * @param operand Matrix to compare
+ * @throws RplMatrixException
*/
-void Matrix::checkSameDimension(const Matrix& operand) const
+void RplMatrix::checkSameDimension(const RplMatrix& operand) const
{
if (m_rows != operand.getRows())
- throw MatrixException(*this,
- "Matrix %s has different row count: %d / %d",
+ throw RplMatrixException(*this,
+ "RplMatrix %s has different row count: %d / %d",
operand.getName().c_str(), m_rows, operand.getRows());
if (m_cols != operand.getCols())
- throw MatrixException(*this,
- "Matrix %s has different column count: %d / %d",
+ throw RplMatrixException(*this,
+ "RplMatrix %s has different column count: %d / %d",
operand.getName().c_str(), m_cols, operand.getCols());
}
*
* @param source the source to copy
*/
-Matrix& Matrix::operator =(const Matrix& source)
+RplMatrix& RplMatrix::operator =(const RplMatrix& source)
{
resize(source.m_rows, source.m_cols, source.m_values);
return *this;
}
/**
- * Adds a matrix to the instance.
+ * Adds a Matrix to the instance.
*
- * @param operand matrix to add
+ * @param operand Matrix to add
* @return the instance itself
*/
-Matrix& Matrix::operator +=(const Matrix& operand)
+RplMatrix& RplMatrix::operator +=(const RplMatrix& operand)
{
checkSameDimension(operand);
for (int ix = m_rows * m_cols - 1; ix >= 0; ix--){
* @param operand matrix to subtract
* @return the instance itself
*/
-Matrix& Matrix::operator -=(const Matrix& operand)
+RplMatrix& RplMatrix::operator -=(const RplMatrix& operand)
{
checkSameDimension(operand);
for (int ix = m_rows * m_cols - 1; ix >= 0; ix--){
/**
* Builds the sum of the instance and a given matrix.
*
- * @param operand matrix to add
- * @return a new matrix with the sum
+ * @param operand RplMatrix to add
+ * @return a new RplMatrix with the sum
*/
-Matrix Matrix::operator +(const Matrix& operand)
+RplMatrix RplMatrix::operator +(const RplMatrix& operand)
{
- Matrix rc(*this);
+ RplMatrix rc(*this);
rc += operand;
return rc;
}
* @param operand matrix to subtract
* @return a new matrix with the difference
*/
-Matrix Matrix::operator -(const Matrix& operand)
+RplMatrix RplMatrix::operator -(const RplMatrix& operand)
{
- Matrix rc(*this);
+ RplMatrix rc(*this);
rc -= operand;
return rc;
}
* @param scalar scalar to add
* @return the instance itself
*/
-Matrix& Matrix::operator +=(MatVal scalar)
+RplMatrix& RplMatrix::operator +=(MatVal scalar)
{
for (int ix = m_rows * m_cols - 1; ix >= 0; ix--){
m_values[ix] += scalar;
* @param scalar scalar to add
* @return the instance itself
*/
-Matrix& Matrix::operator -=(MatVal scalar)
+RplMatrix& RplMatrix::operator -=(MatVal scalar)
{
for (int ix = m_rows * m_cols - 1; ix >= 0; ix--){
m_values[ix] -= scalar;
* @param scalar scalar to add
* @return a new matrix with the sum
*/
-Matrix Matrix::operator +(MatVal scalar)
+RplMatrix RplMatrix::operator +(MatVal scalar)
{
- Matrix rc(*this);
+ RplMatrix rc(*this);
rc += scalar;
return rc;
}
* @param scalar scalar to subtract
* @return a new matrix with the sum
*/
-Matrix Matrix::operator -(MatVal scalar)
+RplMatrix RplMatrix::operator -(MatVal scalar)
{
- Matrix rc(*this);
+ RplMatrix rc(*this);
rc -= scalar;
return rc;
}
* @return true: the matrices are equal<br>
* false: otherwise
*/
-bool Matrix::operator ==(const Matrix& operand) const
+bool RplMatrix::operator ==(const RplMatrix& operand) const
{
checkSameDimension(operand);
bool rc = true;
* @return true: all elements are equal to the scalar<br>
* false: otherwise
*/
-bool Matrix::operator ==(MatVal scalar) const
+bool RplMatrix::operator ==(MatVal scalar) const
{
bool rc = true;
for (int ix = m_rows * m_cols - 1; ix >= 0; ix--){
/**
* Sets a new row-column pair.
*/
-Matrix& Matrix::resize(int rows, int cols, const MatVal values[],
+RplMatrix& RplMatrix::resize(int rows, int cols, const MatVal values[],
MatVal defaultValue)
{
checkDefinition(rows, cols);
*
* @return a tuple with the minimum and the maximum
*/
-Tuple2 Matrix::minMax() const
+Tuple2 RplMatrix::minMax() const
{
+#ifndef DBL_MAX
+#define DBL_MAX std::numeric_limits<qreal>::max()
+#define DBL_MIN std::numeric_limits<qreal>::min()
+#endif
Tuple2 rc(DBL_MAX, DBL_MIN);
for (int ix = m_rows*m_cols - 1; ix >= 0; ix--){
*
* @return the transposed matrix
*/
-Matrix Matrix::transpose() const
+RplMatrix RplMatrix::transpose() const
{
- Matrix rc(m_cols, m_rows);
+ RplMatrix rc(m_cols, m_rows);
for (int row = 0; row < m_rows; row++){
for (int col = 0; col < m_cols; col++){
}
return rc;
}
-std::string Matrix::toString(const char* prefix, const char* format,
+std::string RplMatrix::toString(const char* prefix, const char* format,
const char* rowSeparator, const char* colSeparator) const
{
char buffer[128];
rc += prefix;
rc += "[";
for (int row = 0; row < m_rows; row++){
- for (int col; col < m_cols; col++){
+ for (int col = 0; col < m_cols; col++){
snprintf(buffer, sizeof buffer, format, m_values[m_cols*row + col]);
rc += buffer;
rc += colSeparator;
* Reads a file with the CSV (comma separated values) format
* into the instance.
*/
-void Matrix::readFromCvs(const char* filename, int maxLineLength)
+void RplMatrix::readFromCvs(const char* filename, int maxLineLength)
{
FILE* fp = fopen(filename, "r");
if (fp == NULL)
- throw MatrixException(*this, "Cannot open %s (%d)", filename, errno);
+ throw RplMatrixException(*this, "Cannot open %s (%d)", filename, errno);
char* buffer = new char[maxLineLength];
char* line;
char separator = findSeparator(fp, buffer, maxLineLength);
skipNonNumbers(line, separator);
int col = -1;
int length;
- char* ptr;
+ char* ptr = line;
while( (length = lengthOfNumber(ptr)) > 0){
while(*ptr == ' ')
ptr++;
fclose(fp);
delete buffer;
}
-void readFromXml(const char* filename, const char* tagCol,
+void RplMatrix::readFromXml(const char* filename, const char* tagCol,
const char* tagRow, const char* tagTable,
- int maxLineLength = 1024*1024)
+ int maxLineLength)
{
-
+ throw RplMatrixException(*this, "readFromXml not implementes: %s %s %s %s %d",
+ filename, tagCol, tagRow, tagTable, maxLineLength);
}
-} /* namespace rpl */
/*
- * Matrix.hpp
+ * RplMatrix.hpp
*
* Created on: 29.05.2014
* Author: hm
*/
-#ifndef MATRIX_HPP_
-#define MATRIX_HPP_
+#ifndef RplMatrix_HPP_
+#define RplMatrix_HPP_
-namespace rpl {
-
-class Matrix;
+class RplMatrix;
/**
- * Implements a matrix specific exception.
+ * Implements a RplMatrix specific exception.
*/
-class MatrixException
+class RplMatrixException
{
public:
- MatrixException(const Matrix& matrix, const char* format, ...);
- MatrixException(const char* format, ...);
-private:
+ explicit RplMatrixException(int id, const char* format, ...);
+ explicit RplMatrixException(const RplMatrix& RplMatrix, const char* format, ...);
+public:
const std::string getMessage() const
{ return m_message; }
private:
};
/**
- * The type of a matrix element.
+ * The type of a RplMatrix element.
*/
-typedef double MatVal;
+typedef qreal MatVal;
class Tuple2 {
public:
MatVal m_value2;
};
/**
- * Implements a matrix with 2 dimensions.
+ * Implements a RplMatrix with 2 dimensions.
*/
-class Matrix {
+class RplMatrix {
public:
- Matrix(const char* name = NULL);
- Matrix(int rows, int cols, const char* name = NULL);
- virtual ~Matrix();
- Matrix(const Matrix& source);
- Matrix& operator =(const Matrix& source);
+ RplMatrix(const char* name = NULL);
+ RplMatrix(int rows, int cols, const char* name = NULL);
+ virtual ~RplMatrix();
+ RplMatrix(const RplMatrix& source);
+ RplMatrix& operator =(const RplMatrix& source);
public:
- Matrix& operator +=(const Matrix& operand);
- Matrix& operator -=(const Matrix& operand);
- Matrix operator +(const Matrix& operand);
- Matrix operator -(const Matrix& operand);
- Matrix& operator +=(MatVal scalar);
- Matrix& operator -=(MatVal scalar);
- Matrix operator +(MatVal scalar);
- Matrix operator -(MatVal scalar);
- bool operator ==(const Matrix& operand) const;
+ RplMatrix& operator +=(const RplMatrix& operand);
+ RplMatrix& operator -=(const RplMatrix& operand);
+ RplMatrix operator +(const RplMatrix& operand);
+ RplMatrix operator -(const RplMatrix& operand);
+ RplMatrix& operator +=(MatVal scalar);
+ RplMatrix& operator -=(MatVal scalar);
+ RplMatrix operator +(MatVal scalar);
+ RplMatrix operator -(MatVal scalar);
+ bool operator ==(const RplMatrix& operand) const;
bool operator ==(MatVal scalar) const;
- inline bool operator !=(const Matrix& operand) const
+ inline bool operator !=(const RplMatrix& operand) const
{ return ! (*this == operand); }
inline bool operator !=(MatVal operand)
{ return ! (*this == operand); }
{ return m_name; }
inline MatVal get(int row, int col) const
{ check(row, col); return m_values[row*m_cols + col]; }
- inline Matrix& set(int row, int col, MatVal value)
+ inline RplMatrix& set(int row, int col, MatVal value)
{ check(row, col); m_values[row*m_cols + col] = value; return *this; }
inline int getRows() const
{ return m_rows; }
public:
void checkDefinition(int rows, int cols) const;
void check(int row, int col) const;
- void checkSameDimension(const Matrix& operand) const;
- Matrix& resize(int rows, int cols, const MatVal values[] = NULL,
+ void checkSameDimension(const RplMatrix& operand) const;
+ RplMatrix& resize(int rows, int cols, const MatVal values[] = NULL,
MatVal defaultValue = 0.0);
Tuple2 minMax() const;
- Matrix transpose() const;
+ RplMatrix transpose() const;
std::string toString(const char* prefix = NULL,
const char* format = "%f",
const char* rowSeparator = "\n",
MatVal* m_values;
std::string m_name;
};
-} // namespace rpl
-#endif /* MATRIX_HPP_ */
+
+#endif /* RplMatrix_HPP_ */
+++ /dev/null
-/*
- * Matrix_test.cpp
- *
- * Created on: 29.05.2014
- * Author: hm
- */
-
-#include "stdinc.hpp"
-
-namespace rpl {
-
-} /* namespace rpl */
--- /dev/null
+#ifndef RPLMODULES_HPP
+#define RPLMODULES_HPP
+
+enum {
+ RPLMODULE_LOGGER = 1,
+ RPLMODULE_CONFIG,
+ RPLMODULE_CONTAINER,
+ RPLMODULE_EXCEPTION,
+ RPLMODULE_TEST, // 5
+ RPLMODULE_TCPSERVER,
+ RPLMODULE_TCPCLIENT,
+ RPLMODULE_TCPPEER,
+ RPLMODULE_TERMINATOR,
+
+ // last element:
+ RPLMODULE_COUNT
+};
+#define RPL_FIRST_OF(moduleNo) (moduleNo*1000+1)
+class RplModules{
+public:
+ static int fileToNumber(const char* file);
+ static const char* numberToFile(int location);
+};
+
+
+#endif // RPLMODULES_HPP
--- /dev/null
+#! /usr/bin/perl
+
+use strict;
+
+my @rc;
+push @rc, &oneDir("../rplcore/*.hpp");
+push @rc, &oneDir("../rplmath/*.hpp");
+push @rc, &oneDir("../rplnet/*.hpp");
+push @rc, "\n";
+push @rc, &oneDir("../rplcore/*.cpp");
+push @rc, &oneDir("../rplmath/*.cpp");
+push @rc, &oneDir("../rplnet/*.cpp");
+
+print @rc;
+exit 0;
+
+sub oneDir{
+ my $pattern = shift;
+ my @rc;
+ open (my $INP, "ls -1 $pattern|") || die "ls -1 $pattern: $!";
+ while(<$INP>) {
+ if (/(\S+)/){
+ push(@rc, " $1 \\\n");
+ }
+ }
+ return @rc;
+}
+
+
TEMPLATE = lib
CONFIG += staticlib
-SOURCES += rplstaticlib.cpp ../rplmath/rplmatrix.cpp ../rplmath/rplenigma.cpp
+INCLUDEPATH = ..
+
+SOURCES += \
+ ../rplcore/rplconfig.cpp \
+ ../rplcore/rplcontainer.cpp \
+ ../rplcore/rplexception.cpp \
+ ../rplcore/rpllogger.cpp \
+ ../rplcore/rplstring.cpp \
+ ../rplcore/rplterminator.cpp \
+ ../rplcore/rpltest.cpp \
+ ../rplmath/rplenigma.cpp \
+ ../rplmath/rplmatrix.cpp \
+ ../rplmath/rplmatrix_test.cpp \
+ ../rplmath/rplrandom.cpp \
+ ../rplnet/rplnetconfig.cpp \
+ ../rplnet/rpltcpclient.cpp \
+ ../rplnet/rpltcppeer.cpp \
+ ../rplnet/rpltcpserver.cpp \
+
+HEADERS += ../rplmodules.hpp \
+ ../rplcore/rplconfig.hpp \
+ ../rplcore/rplconfigurator.hpp \
+ ../rplcore/rplcontainer.hpp \
+ ../rplcore/rplcore.hpp \
+ ../rplcore/rplexception.hpp \
+ ../rplcore/rpllogger.hpp \
+ ../rplcore/rplstring.hpp \
+ ../rplcore/rplterminator.hpp \
+ ../rplcore/rpltest.hpp \
+ ../rplmath/rplenigma.hpp \
+ ../rplmath/rplmath.hpp \
+ ../rplmath/rplmatrix.hpp \
+ ../rplmath/rplrandom.hpp \
+ ../rplnet/rplnetconfig.hpp \
+ ../rplnet/rplnet.hpp \
+ ../rplnet/rpltcpclient.hpp \
+ ../rplnet/rpltcppeer.hpp \
+ ../rplnet/rpltcpserver.hpp \
-HEADERS += rplstaticlib.hpp ../rplmath/rplmatrix.hpp ../rplmath/rplenigma.hpp
unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
--- /dev/null
+/*
+ * Licence:
+ * You can use and modify this file without any restriction.
+ * There is no warranty.
+ * You also can use the licence from http://www.wtfpl.net/.
+ * The original sources can be found on https://github.com/republib.
+*/
+#include "../rplcore/rplcore.hpp"
+#include "../rplmath/rplmath.hpp"
+
+#include <QCoreApplication>
+
+int main(int argc, char *argv[])
+{
+ //QCoreApplication a(argc, argv);
+ if (argc > 1)
+ printf("not used: %s\n", argv[1]);
+ //return a.exec();
+ extern void testRplMatrix();
+ testRplMatrix();
+}
--- /dev/null
+/*
+ * Matrix_test.cpp
+ *
+ * Created on: 29.05.2014
+ * Author: hm
+ */
+#include "rplcore/rplcore.hpp"
+#include "rplmath/rplmath.hpp"
+#include "rplcore/rpltest.hpp"
+
+class TestRplMatrix : public RplTest{
+public:
+ TestRplMatrix() : RplTest("RplMatrix") {}
+
+public:
+ void testBasic() {
+ Tuple2 tuple(-2.0, 0.5);
+ checkE(-2.0, tuple.m_value1);
+ checkE(0.5, tuple.m_value2);
+ try{
+ throw RplMatrixException(1, "String: %s and int %d", "Hi", -333);
+ checkF(true);
+ } catch (RplMatrixException exc){
+ checkE("String: Hi and int -333", exc.getMessage());
+ }
+ RplMatrix mat("mx");
+ try{
+ throw RplMatrixException(mat, "String: %s and int %d", "Hi", -333);
+ checkF(true);
+ } catch (RplMatrixException exc){
+ checkE("mx: String: Hi and int -333", exc.getMessage());
+ }
+ RplMatrix mat2;
+ try{
+ throw RplMatrixException(mat2, "String: %s and int %d", "Hi", -333);
+ checkF(true);
+ } catch (RplMatrixException exc){
+ checkE("String: Hi and int -333", exc.getMessage());
+ }
+ }
+ virtual void doIt() {
+ testBasic();
+ }
+};
+void testRplMatrix() {
+ TestRplMatrix test;
+ test.run();
+}
--- /dev/null
+#-------------------------------------------------
+#
+# Project created by QtCreator 2014-05-31T00:01:23
+#
+#-------------------------------------------------
+
+QT += core network
+
+QT -= gui
+
+TARGET = unittests
+CONFIG += console
+CONFIG -= app_bundle
+
+INCLUDEPATH = ..
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+ rplmatrix_test.cpp \
+ ../rplmath/rplmatrix.cpp
+