1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#include <stdlib.h> 17#include <string.h> 18#include "functionalext.h" 19 20/** 21 * @tc.name : strcasecmp_0100 22 * @tc.desc : Verify strcasecmp process success when fist string equal second stirng 23 * @tc.level : Level 0 24 */ 25void strcasecmp_0100(void) 26{ 27 int32_t ret = strcasecmp("aBcDeF", "AbCdEf"); 28 EXPECT_EQ("strcasecmp_0100", ret, 0); 29} 30 31/** 32 * @tc.name : strcasecmp_0200 33 * @tc.desc : Verify strcasecmp process success when fist string less than second stirng 34 * @tc.level : Level 1 35 */ 36void strcasecmp_0200(void) 37{ 38 int32_t ret = strcasecmp("", "AbCdEf"); 39 EXPECT_LT("strcasecmp_0200", ret, 0); 40} 41 42/** 43 * @tc.name : strcasecmp_0300 44 * @tc.desc : Verify strcasecmp process success when fist string more than second stirng 45 * @tc.level : Level 1 46 */ 47void strcasecmp_0300(void) 48{ 49 int32_t ret = strcasecmp("AbCdEf", ""); 50 EXPECT_MT("strcasecmp_0300", ret, 0); 51} 52 53/** 54 * @tc.name : strcasecmp_0400 55 * @tc.desc : Verify strcasecmp process success when fist string is null second stirng is null 56 * @tc.level : Level 1 57 */ 58void strcasecmp_0400(void) 59{ 60 int32_t ret = strcasecmp("", ""); 61 EXPECT_EQ("strcasecmp_0400", ret, 0); 62} 63 64int main(void) 65{ 66 strcasecmp_0100(); 67 strcasecmp_0200(); 68 strcasecmp_0300(); 69 strcasecmp_0400(); 70 return t_status; 71} 72