diff options
Diffstat (limited to 'unittest/gtest_hal_touchscreen.cpp')
-rwxr-xr-x | unittest/gtest_hal_touchscreen.cpp | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/unittest/gtest_hal_touchscreen.cpp b/unittest/gtest_hal_touchscreen.cpp deleted file mode 100755 index 046cef8..0000000 --- a/unittest/gtest_hal_touchscreen.cpp +++ /dev/null @@ -1,83 +0,0 @@ - -#include <iostream> -#include <gtest/gtest.h> -#include "hw/common.h" -#include "hw/touchscreen.h" - -using namespace std; - -/* - * main class - */ -struct hw_info *info; -struct touchscreen_device *touchscreen_dev; - -class TOUCHSCREENHalTest : public testing::Test -{ - public: - virtual void SetUp() - { - - } - - virtual void TearDown() - { - - } -}; - -/* - * testcase - */ -TEST_F(TOUCHSCREENHalTest, InitP) -{ - int ret; - - ret = hw_get_info(TOUCHSCREEN_HARDWARE_DEVICE_ID, - (const struct hw_info **)&info); - if (ret < 0) { - cout << "There is no device for touchscreen" << ret << endl; - return; - } else { - EXPECT_EQ(ret, 0) << "Fail to get hal for touchscreen (" << ret << ")"; - } - - if (!info || !info->open) { - cout << "There is no function for info open" << endl; - return; - } - ret = info->open(info, NULL, (struct hw_common**)&touchscreen_dev); - EXPECT_EQ(ret, 0) << "Fail to open touchscreen device (" << ret << ")"; -} - -TEST_F(TOUCHSCREENHalTest, SetstateP) -{ - enum touchscreen_state state = TOUCHSCREEN_ON; - int ret; - - if (!touchscreen_dev || !touchscreen_dev->set_state) { - cout << "There is no function for set_state" << endl; - return; - } - ret = touchscreen_dev->set_state(state); - EXPECT_EQ(ret, 0) << "Fail to set_state (" << ret << ")"; -} - -TEST_F(TOUCHSCREENHalTest, DeinitP) -{ - int ret; - - if (!info || !info->close) { - cout << "There is no function for info close" << endl; - return; - } - ret = info->close((struct hw_common *)touchscreen_dev); - EXPECT_EQ(ret, 0) << "Fail to close touchscreen device (" << ret << ")"; -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); -} |