Commit b8736882 by 刘帅

添加测试工程文件

parent 3b63bf88
......@@ -30,7 +30,6 @@ ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
*.manifest
......
#-------------------------------------------------
#
# Project created by QtCreator 2017-12-12T18:08:21
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = fmclient
TEMPLATE = app
LIBS += -L$$PWD/lib/
LIBS += -lfmcrypt
LIBS += -L$$PWD/out32dll
INCLUDEPATH += $$PWD/openssl
INCLUDEPATH += ./encrypt \
$$PWD/gtest \
$$PWD/base
include(./QsLog/QsLog.pri)
CONFIG(debug, debug|release){
DESTDIR = $$PWD/bin/debug
}else
{
DESTDIR = $$PWD/bin/release
}
SOURCES += main_test.cpp\
widget.cpp \
qfmclient.cpp \
scanner.cpp \
encrypt/encrypt.cpp \
base/FmPee.cpp \
base/FPe.cpp \
base/md5.cpp \
verifysign.cpp
HEADERS += widget.h \
fmcrypt.h \
qfmclient.h \
app_single.h \
log.h \
utility.h \
scanner.h \
encrypt/encrypt.h \
qfmclient_test.h \
encrypt/encrypt_test.h \
app_single_test.h \
base/FmPee.h \
base/FPe.h \
base/md5.h \
verifysign.h \
verifysign_test.h
FORMS += widget.ui \
scanner.ui
RC_FILE += version.rc
#include "widget.h"
#include <QApplication>
#include "qfmclient.h"
#include "app_single.h"
#include "log.h"
#include "verifysign.h"
#include "base/FPe.h"
#include "scanner.h"
#include "gtest/gtest.h"
#include "qfmclient_test.h"
#include "encrypt/encrypt_test.h"
#include "app_single_test.h"
#include "verifysign_test.h"
#ifdef QT_DEBUG
#pragma comment (lib, "gtestd.lib")
#pragma comment (lib, "gtest_maind.lib")
#else
#pragma comment (lib, "gtest.lib")
#pragma comment (lib, "gtest_main.lib")
#endif
#define USE_TEST
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
#ifndef USE_TEST
if(!checkOnly())
{
OutputDebugString(L"FmclientUi running.");
return 0;
}
QString filePath = QCoreApplication::applicationFilePath();
FPE::SetMy(TRUE);
std::string rData = FPE::ReadDate((char*)filePath.toStdString().c_str());
OutputDebugStringA(rData.c_str());
if(!VerifySign(filePath.toStdString(), rData))
{
qDebug() << "verify failed! this application can not run.";
return 0;
}
// QFmClient client;
// if(!client.verifyWhitelists())
// {
// OutputDebugStringA("verify whitelists failed");
// return 0;
// }
InitLogger();
QLOG_INFO()<<"start FmclientUi...";
Widget w;
scanner s;
QFmClient client;
QObject::connect(&client,&QFmClient::HideUi, &w, &Widget::hide,Qt::QueuedConnection);
QObject::connect(&client,&QFmClient::ShowUi, &w, &Widget::showRequesting,Qt::QueuedConnection);
QObject::connect(&client, &QFmClient::ShowRefundUi, &s, &scanner::showRefund);
QObject::connect(&s, SIGNAL(fetched(QString)), &client, SLOT(SetTransactionId(QString)));
QObject::connect(&client,&QFmClient::finished, &a, &a.quit);
client.start();
return a.exec();
#else
testing::InitGoogleTest(&argc, argv);
RUN_ALL_TESTS();
return 0;
#endif
}
#if defined(UNDER_CE)
#include <winbase.h>
#else
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,3,0
PRODUCTVERSION 1,0,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "CompanyName", "Freemud\0"
VALUE "FileDescription", "Freemud client\0"
VALUE "FileVersion", "1.0.3.0\0"
VALUE "ProductVersion", "1.0.3.0\0"
VALUE "LegalCopyright", "Copyright (C) Freemud\0"
VALUE "LegalTrademarks", "Freemud\0"
VALUE "OriginalFilename", "fmclient.exe\0"
VALUE "ProductName", "client\0"
VALUE "InternalName", "fmclient.exe\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x804, 1200
END
END
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