7
7
8
8
#include " core/performance/include/performance.hpp"
9
9
#include " core/performance/tests/test_task.hpp"
10
+ #include " core/util/include/util.hpp"
10
11
11
12
TEST (perf_tests, check_perf_pipeline) {
12
13
std::vector<uint32_t > in (2000 , 1 );
@@ -99,7 +100,7 @@ TEST_P(GetStringParamNameParamTest, ReturnsExpectedString) {
99
100
EXPECT_EQ (ppc::core::GetStringParamName (param.input ), param.expected_output );
100
101
}
101
102
102
- INSTANTIATE_TEST_SUITE_P (ParamTests, GetStringParamNameParamTest,
103
+ INSTANTIATE_TEST_SUITE_P_NOLINT (ParamTests, GetStringParamNameParamTest,
103
104
::testing::Values (ParamTestCase{ppc::core::PerfResults::kTaskRun , " task_run" },
104
105
ParamTestCase{ppc::core::PerfResults::kPipeline , " pipeline" },
105
106
ParamTestCase{static_cast <ppc::core::PerfResults::TypeOfRunning>(999 ),
@@ -144,7 +145,7 @@ INSTANTIATE_TEST_SUITE_P_NOLINT(AllTypeCases, GetStringTaskTypeTest,
144
145
TaskTypeTestCase{ppc::core::TypeOfTask::kTBB , " tbb_TBB" , " kTBB" },
145
146
TaskTypeTestCase{ppc::core::TypeOfTask::kSEQ , " seq_SEQ" , " kSEQ" }));
146
147
147
- DEATH_TEST (GetStringTaskTypeStandaloneTest, ThrowsIfFileMissing) {
148
+ TEST_NOLINT (GetStringTaskTypeStandaloneTest, ThrowsIfFileMissing) {
148
149
std::string missing_path = " non_existent_settings.json" ;
149
150
EXPECT_THROW_NOLINT (GetStringTaskType (ppc::core::TypeOfTask::kSEQ , missing_path), std::runtime_error);
150
151
}
@@ -159,12 +160,12 @@ TEST(GetStringTaskTypeStandaloneTest, ReturnsUnknownForInvalidEnum) {
159
160
std::filesystem::remove (path);
160
161
}
161
162
162
- TEST (GetStringTaskTypeEdgeCases, ThrowsIfFileCannotBeOpened) {
163
+ TEST_NOLINT (GetStringTaskTypeEdgeCases, ThrowsIfFileCannotBeOpened) {
163
164
EXPECT_THROW_NOLINT (GetStringTaskType (ppc::core::TypeOfTask::kSEQ , " definitely_missing_file.json" ),
164
165
std::runtime_error);
165
166
}
166
167
167
- TEST (GetStringTaskTypeEdgeCases, ThrowsIfJsonIsMalformed) {
168
+ TEST_NOLINT (GetStringTaskTypeEdgeCases, ThrowsIfJsonIsMalformed) {
168
169
std::string path = std::filesystem::temp_directory_path () / " bad_json.json" ;
169
170
std::ofstream (path) << " { this is not valid json " ;
170
171
EXPECT_THROW_NOLINT (GetStringTaskType (ppc::core::TypeOfTask::kSEQ , path), nlohmann::json::parse_error);
@@ -175,7 +176,7 @@ TEST(GetStringTaskTypeEdgeCases, ThrowsIfJsonValueIsNull) {
175
176
std::string path = std::filesystem::temp_directory_path () / " null_value.json" ;
176
177
std::ofstream (path) << R"( {"tasks": { "seq": null }})" ;
177
178
178
- EXPECT_THROW (GetStringTaskType (ppc::core::TypeOfTask::kSEQ , path), nlohmann::json::type_error);
179
+ EXPECT_THROW_NOLINT (GetStringTaskType (ppc::core::TypeOfTask::kSEQ , path), nlohmann::json::type_error);
179
180
180
181
std::filesystem::remove (path);
181
182
}
@@ -224,9 +225,9 @@ TEST(TaskTest, GetDynamicTypeReturnsCorrectEnum) {
224
225
EXPECT_EQ (task.GetDynamicTypeOfTask (), ppc::core::TypeOfTask::kOMP );
225
226
}
226
227
227
- DEATH_TEST (TaskTest, DestructorTerminatesIfWrongOrder) {
228
+ TEST_NOLINT (TaskTest, DestructorTerminatesIfWrongOrder) {
228
229
testing::FLAGS_gtest_death_test_style = " threadsafe" ;
229
- ASSERT_DEATH_IF_SUPPORTED (
230
+ ASSERT_DEATH_IF_SUPPORTED_NOLINT (
230
231
{
231
232
DummyTask task;
232
233
task.Run ();
@@ -249,17 +250,17 @@ using TestTypes = ::testing::Types<my::nested::Type, my::Another, int, std::vect
249
250
250
251
TYPED_TEST_SUITE (GetNamespaceTest, TestTypes);
251
252
252
- TYPED_TEST (GetNamespaceTest, ExtractsNamespaceCorrectly) {
253
- constexpr std::string_view ns = ppc::util::GetNamespace<TypeParam>();
253
+ TYPED_TEST_NOLINT (GetNamespaceTest, ExtractsNamespaceCorrectly) {
254
+ constexpr std::string_view kNs = ppc::util::GetNamespace<TypeParam>();
254
255
255
256
if constexpr (std::is_same_v<TypeParam, my::nested::Type>) {
256
- EXPECT_EQ (ns , " my::nested" );
257
+ EXPECT_EQ (kNs , " my::nested" );
257
258
} else if constexpr (std::is_same_v<TypeParam, my::Another>) {
258
- EXPECT_EQ (ns , " my" );
259
+ EXPECT_EQ (kNs , " my" );
259
260
} else if constexpr (std::is_same_v<TypeParam, int >) {
260
- EXPECT_EQ (ns , " " );
261
+ EXPECT_EQ (kNs , " " );
261
262
} else if constexpr (std::is_same_v<TypeParam, std::vector<int >>) {
262
- EXPECT_EQ (ns , " std" );
263
+ EXPECT_EQ (kNs , " std" );
263
264
} else {
264
265
FAIL () << " Unhandled type in test" ;
265
266
}
0 commit comments