Commit cef05731 by xiaoqing.gu

autotest/session/addData

parent a6840766
......@@ -8,7 +8,8 @@ CONFIG += qt console warn_on depend_includepath testcase
HEADERS += \
tst_db_query.h \
tst_db_create.h
tst_db_create.h \
tst_session.h
SOURCES += main.cpp
......
#include "tst_db_create.h"
#include "tst_db_query.h"
#include "tst_session.h"
#include <gtest/gtest.h>
......
#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
......@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 48
#define VER_BUILD 49
//! Convert version numbers to string
#define _STR(S) #S
......
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