You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.3 KiB
31 lines
1.3 KiB
1 year ago
|
/*
|
||
|
* Copyright (c) 2023 - 2024. KeyWare.Co.Ltd All rights reserved.
|
||
|
* 项目名称:C++ 信息安全性设计准则
|
||
|
* 项目描述:用于检查C++源代码的安全性设计准则的Sonarqube插件
|
||
|
* 版权说明:本软件属北京关键科技股份有限公司所有,在未获得北京关键科技股份有限公司正式授权情况下,任何企业和个人,不能获取、阅读、安装、传播本软件涉及的任何受知识产权保护的内容。
|
||
|
*/
|
||
|
package com.keyware.sonar.cxx;
|
||
|
|
||
|
import org.junit.jupiter.api.Test;
|
||
|
import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||
|
|
||
|
class CxxSonarWayProfileTest {
|
||
|
|
||
|
@Test
|
||
|
void should_create_sonar_way_profile() {
|
||
|
var profileDef = new CxxSonarWayProfile();
|
||
|
var context = new BuiltInQualityProfilesDefinition.Context();
|
||
|
profileDef.define(context);
|
||
|
BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("cxx", "Sonar way");
|
||
|
assertThat(profile.language()).isEqualTo(CxxLanguage.KEY);
|
||
|
assertThat(profile.name()).isEqualTo("Sonar way");
|
||
|
List<BuiltInQualityProfilesDefinition.BuiltInActiveRule> activeRules = profile.rules();
|
||
|
assertThat(activeRules.size()).as("Expected number of rules in profile").isNotNegative();
|
||
|
}
|
||
|
|
||
|
}
|