Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaojing.zhang
fmp_vip
Commits
cef05731
Commit
cef05731
authored
Feb 08, 2018
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autotest/session/addData
parent
a6840766
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
tests/autotest/autotest.pro
+2
-1
tests/autotest/main.cpp
+1
-0
tests/autotest/tst_session.h
+36
-0
version.h
+1
-1
No files found.
tests/autotest/autotest.pro
View file @
cef05731
...
@@ -8,7 +8,8 @@ CONFIG += qt console warn_on depend_includepath testcase
...
@@ -8,7 +8,8 @@ CONFIG += qt console warn_on depend_includepath testcase
HEADERS
+=
\
HEADERS
+=
\
tst_db_query
.
h
\
tst_db_query
.
h
\
tst_db_create
.
h
tst_db_create
.
h
\
tst_session
.
h
SOURCES
+=
main
.
cpp
SOURCES
+=
main
.
cpp
...
...
tests/autotest/main.cpp
View file @
cef05731
#include "tst_db_create.h"
#include "tst_db_create.h"
#include "tst_db_query.h"
#include "tst_db_query.h"
#include "tst_session.h"
#include <gtest/gtest.h>
#include <gtest/gtest.h>
...
...
tests/autotest/tst_session.h
0 → 100644
View file @
cef05731
#ifndef TST_SESSION_H
#define TST_SESSION_H
#include "session.h"
#include <gtest/gtest.h>
using
namespace
testing
;
class
TestSession
:
public
::
testing
::
Test
{
};
TEST_F
(
TestSession
,
AddData
)
{
Session
s
;
s
.
addData
(
"string"
,
"string"
);
s
.
addData
(
"int"
,
1
);
s
.
addData
(
"bool"
,
true
);
EXPECT_EQ
(
s
.
data
(
"string"
).
toString
(),
"string"
);
EXPECT_EQ
(
s
.
data
(
"int"
).
toInt
(),
1
);
EXPECT_NE
(
s
.
data
(
"int"
).
toInt
(),
2
);
EXPECT_EQ
(
s
.
data
(
"bool"
).
toBool
(),
true
);
}
TEST_F
(
TestSession
,
Clear
)
{
Session
s
;
s
.
addData
(
"string"
,
"s"
);
EXPECT_EQ
(
s
.
data
(
"string"
).
toString
(),
"s"
);
s
.
clear
();
EXPECT_EQ
(
s
.
data
(
"string"
).
toString
(),
""
);
}
#endif // TST_SESSION_H
version.h
View file @
cef05731
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_REVISION 0
#define VER_BUILD 4
8
#define VER_BUILD 4
9
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment