2 // Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include "tct_common.h"
24 #include "tct-stc-core.h"
30 #include <gtest/gtest.h>
34 #include <sys/types.h>
40 char *pszGetTCName = NULL;
41 pszGetTCName = (char*)malloc( 256 );
42 memset( pszGetTCName, 0x00, 256);
43 strcpy( pszGetTCName, "utc_stc");
46 PRINT_LOG(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
50 for ( i = 0; tc_array[i].name; i++ )
53 PRINT_LOG(DLOG_INFO, "NativeTCT", "===========================================");
54 PRINT_LOG(DLOG_INFO, "NativeTCT", "[%s]", tc_array[i].name);
55 if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
57 if ( tc_array[i].startup )
59 tc_array[i].startup();
62 result = tc_array[i].function();
68 PRINT_LOG(DLOG_INFO, "NativeTCT", "[Error][%d] %s returns value = %d", i, tc_array[i].name, result);
73 // ASSERT_EQ(result, 0);
75 if ( tc_array[i].cleanup )
77 tc_array[i].cleanup();
81 PRINT_LOG(DLOG_INFO, "NativeTCT", "Name check error! [%s][%s]", pszGetTCName, tc_array[i].name);
85 PRINT_LOG(DLOG_INFO, "NativeTCT", "===========================================");
88 PRINT_LOG(DLOG_INFO, "NativeTCT", "==========================");
89 PRINT_LOG(DLOG_INFO, "NativeTCT", "Success [%4d / %4d]", successCnt, successCnt + errorCnt);
90 PRINT_LOG(DLOG_INFO, "NativeTCT", "Error [%4d / %4d]", errorCnt, successCnt + errorCnt);
91 PRINT_LOG(DLOG_INFO, "NativeTCT", "==========================");
93 FREE_MEMORY_TC(pszGetTCName);
96 int main(int argc, char** argv) {
97 ::testing::InitGoogleTest(&argc, argv);
98 return RUN_ALL_TESTS();