Move intdup to qthelper

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-05-07 09:41:27 +03:00
parent 0d36b6e4e8
commit ab1813a445
4 changed files with 12 additions and 18 deletions

View file

@ -4,6 +4,7 @@
#include "core/file.h"
#include "core/divelist.h"
#include <QTextStream>
#include "core/qthelper.h"
/* We have to use a macro since QCOMPARE
* can only be called from a test method
@ -42,15 +43,6 @@ void TestParse::cleanup()
sqlite3_close(_sqlite3_handle);
}
char *intdup(int index)
{
char tmpbuf[21];
snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
tmpbuf[20] = 0;
return strdup(tmpbuf);
}
int TestParse::parseCSV(int units, std::string file)
{
// some basic file parsing tests