Skip to content

Commit 1579663

Browse files
committed
Remove unused JSON include and adjust const qualifier.
Removed redundant include of `nlohmann/json.hpp` in multiple files and migrated its usage into `util.hpp` while adding required safeguards for compatibility. Also replaced `constexpr` with `const` for `kTestParam` to align with its usage.
1 parent e01b19d commit 1579663

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

modules/core/task/include/task.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <algorithm>
44
#include <chrono>
5+
#include <core/util/include/util.hpp>
56
#include <cstddef>
67
#include <cstdlib>
78
#include <exception>
@@ -14,8 +15,6 @@
1415
#include <string>
1516
#include <utility>
1617

17-
#include "nlohmann/json.hpp"
18-
1918
using namespace std::chrono;
2019

2120
namespace ppc::core {

modules/core/util/include/func_test_util.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "core/perf/include/perf.hpp"
1313
#include "core/util/include/util.hpp"
14-
#include "nlohmann/json.hpp"
1514

1615
namespace ppc::util {
1716

modules/core/util/include/perf_test_util.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "core/perf/include/perf.hpp"
1313
#include "core/util/include/util.hpp"
14-
#include "nlohmann/json.hpp"
1514

1615
namespace ppc::util {
1716

modules/core/util/include/util.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
#pragma once
2+
#include <cstdint>
23
#include <string>
34
#include <string_view>
45

6+
#ifdef _MSC_VER
7+
#pragma warning(push)
8+
#pragma warning(disable : 4459) // переменная 'last' перекрывает глобальную
9+
#endif
10+
11+
#include <nlohmann/json.hpp>
12+
13+
#ifdef _MSC_VER
14+
#pragma warning(pop)
15+
#endif
16+
517
/* NOLINTBEGIN */
618
#define INSTANTIATE_TEST_SUITE_P_NOLINT(prefix, test_case_name, generator, custom_test_name) \
719
INSTANTIATE_TEST_SUITE_P(prefix, test_case_name, generator, custom_test_name)

tasks/example/tests/functional/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ namespace {
6464

6565
TEST_P(NesterovARunFuncTests, MatmulFromPic) { ExecuteTest(GetParam()); }
6666

67-
constexpr std::array<TestType, 3> kTestParam = {std::make_tuple(5, "5"), std::make_tuple(10, "10"),
68-
std::make_tuple(15, "15")};
67+
const std::array<TestType, 3> kTestParam = {std::make_tuple(5, "5"), std::make_tuple(10, "10"),
68+
std::make_tuple(15, "15")};
6969

7070
INIT_TASK_GENERATOR(InType, kTestParam)
7171

0 commit comments

Comments
 (0)