/* * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include #include #include "tct_common.h" #ifdef __cplusplus extern "C" { #endif #include "tct-user-awareness-core.h" #ifdef __cplusplus } #endif #include #include #include #include #include #include #include TEST(user_awareness, public) { char *pszGetTCName = NULL; pszGetTCName = (char *)malloc(256); memset(pszGetTCName, 0x00, 256); strcpy(pszGetTCName, "utc_ua"); int i = 0, result = 0; PRINT_LOG(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); int successCnt = 0; int errorCnt = 0; for (i = 0; tc_array[i].name; i++) { if (0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName))) { if (tc_array[i].startup) tc_array[i].startup(); result = tc_array[i].function(); if (result == 0) { successCnt++; } else { PRINT_LOG(DLOG_INFO, "NativeTCT", "[Error][%d] %s returns value = %d", i, tc_array[i].name, result); errorCnt++; } EXPECT_EQ(result, 0); // ASSERT_EQ(result, 0); if (tc_array[i].cleanup) tc_array[i].cleanup(); } else { PRINT_LOG(DLOG_INFO, "NativeTCT", "Name check error! [%s][%s]", pszGetTCName, tc_array[i].name); errorCnt++; } } PRINT_LOG(DLOG_INFO, "NativeTCT", "=========================="); PRINT_LOG(DLOG_INFO, "NativeTCT", "Success [%4d / %4d]", successCnt, successCnt + errorCnt); PRINT_LOG(DLOG_INFO, "NativeTCT", "Error [%4d / %4d]", errorCnt, successCnt + errorCnt); PRINT_LOG(DLOG_INFO, "NativeTCT", "=========================="); FREE_MEMORY_TC(pszGetTCName); return; } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }