Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit bb587c7

Browse files
authored
Remove "using namespace std" from headers, even in tests (#47)
Signed-off-by: Emerson Knapp <[email protected]>
1 parent 8cf0fff commit bb587c7

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

kinesis_video_streamer/test/kinesis_video_streamer_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ constexpr double kMultipleCallbacksWaitTime = 5;
5252
} \
5353
ASSERT_TRUE(expr)
5454

55-
using namespace std;
5655
using namespace Aws::Kinesis;
5756
using namespace Aws::Utils::Logging;
57+
using namespace std;
5858

5959
queue<rosgraph_msgs::Log> * kRosoutQueue = nullptr;
6060
TestData * kTestData = nullptr;

kinesis_video_streamer/test/kinesis_video_streamer_test_utils.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <kinesis_video_streamer/ros_stream_subscription_installer.h>
2121
#include <kinesis_video_streamer/streamer.h>
2222

23-
using namespace std;
2423
using namespace com::amazonaws::kinesis::video;
2524
using namespace Aws;
2625
using namespace Aws::Client;
@@ -91,13 +90,13 @@ struct MockStreamDefinitionProvider : public StreamDefinitionProvider
9190
return data_->get_codec_private_data_return_value;
9291
}
9392

94-
unique_ptr<StreamDefinition> GetStreamDefinition(const ParameterPath & prefix,
93+
std::unique_ptr<StreamDefinition> GetStreamDefinition(const ParameterPath & prefix,
9594
const ParameterReaderInterface & reader,
9695
const PBYTE codec_private_data,
9796
uint32_t codec_private_data_size) const override
9897
{
9998
data_->get_stream_definition_call_count++;
100-
return unique_ptr<StreamDefinition>(data_->get_stream_definition_return_value);
99+
return std::unique_ptr<StreamDefinition>(data_->get_stream_definition_return_value);
101100
}
102101
};
103102

@@ -124,7 +123,7 @@ class TestParameterReader : public ParameterReaderInterface
124123
public:
125124
TestParameterReader() { TestParameterReader(""); }
126125

127-
TestParameterReader(string test_prefix)
126+
TestParameterReader(std::string test_prefix)
128127
{
129128
int_map_ = {
130129
{test_prefix + "retention_period", 2},
@@ -155,8 +154,8 @@ class TestParameterReader : public ParameterReaderInterface
155154
};
156155
}
157156

158-
TestParameterReader(map<string, int> int_map, map<string, bool> bool_map,
159-
map<string, string> string_map, map<string, map<string, string>> map_map)
157+
TestParameterReader(std::map<std::string, int> int_map, std::map<std::string, bool> bool_map,
158+
std::map<std::string, std::string> string_map, std::map<std::string, std::map<std::string, std::string>> map_map)
160159
: int_map_(int_map), bool_map_(bool_map), string_map_(string_map), map_map_(map_map)
161160
{
162161
}
@@ -181,7 +180,7 @@ class TestParameterReader : public ParameterReaderInterface
181180
return AWS_ERR_NOT_FOUND;
182181
}
183182

184-
AwsError ReadParam(const ParameterPath & param_path, string & out) const
183+
AwsError ReadParam(const ParameterPath & param_path, std::string & out) const
185184
{
186185
std::string name = FormatParameterPath(param_path);
187186
if (string_map_.count(name) > 0) {
@@ -196,7 +195,7 @@ class TestParameterReader : public ParameterReaderInterface
196195
return AWS_ERR_EMPTY;
197196
}
198197

199-
AwsError ReadParam(const ParameterPath & param_path, map<string, string> & out) const
198+
AwsError ReadParam(const ParameterPath & param_path, std::map<std::string, std::string> & out) const
200199
{
201200
std::string name = FormatParameterPath(param_path);
202201
if (map_map_.count(name) > 0) {
@@ -216,10 +215,10 @@ class TestParameterReader : public ParameterReaderInterface
216215
return AWS_ERR_EMPTY;
217216
}
218217

219-
map<string, int> int_map_;
220-
map<string, bool> bool_map_;
221-
map<string, string> string_map_;
222-
map<string, map<string, string>> map_map_;
218+
std::map<std::string, int> int_map_;
219+
std::map<std::string, bool> bool_map_;
220+
std::map<std::string, std::string> string_map_;
221+
std::map<std::string, std::map<std::string, std::string>> map_map_;
223222

224223
private:
225224
std::string FormatParameterPath(const ParameterPath & param_path) const
@@ -243,10 +242,10 @@ struct MockStreamManager : public KinesisStreamManagerInterface
243242
}
244243

245244
KinesisManagerStatus InitializeVideoProducer(
246-
std::string region, unique_ptr<DeviceInfoProvider> device_info_provider,
247-
unique_ptr<ClientCallbackProvider> client_callback_provider,
248-
unique_ptr<StreamCallbackProvider> stream_callback_provider,
249-
unique_ptr<CredentialProvider> credential_provider,
245+
std::string region, std::unique_ptr<DeviceInfoProvider> device_info_provider,
246+
std::unique_ptr<ClientCallbackProvider> client_callback_provider,
247+
std::unique_ptr<StreamCallbackProvider> stream_callback_provider,
248+
std::unique_ptr<CredentialProvider> credential_provider,
250249
VideoProducerFactory video_producer_factory) override
251250
{
252251
data_->initialize_video_producer_call_count++;
@@ -261,7 +260,7 @@ struct MockStreamManager : public KinesisStreamManagerInterface
261260
}
262261

263262
KinesisManagerStatus InitializeVideoStream(
264-
unique_ptr<StreamDefinition> stream_definition) override
263+
std::unique_ptr<StreamDefinition> stream_definition) override
265264
{
266265
data_->initialize_video_stream_call_count++;
267266
return data_->initialize_video_stream_return_value;

0 commit comments

Comments
 (0)