Code style: Declare (Type& value) instead of (Type &value)
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 0b4aa26..d550a16 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -59,7 +59,7 @@
1
};
-static void dumpData(const Data &data)
+static void dumpData(const Data& data)
{
cout << "name: " << data.getName().to_uri() << endl;
if (data.getContent().size() > 0) {
@@ -173,7 +173,7 @@
dumpData(freshData);
ptr_lib::shared_ptr<vector<unsigned char> > freshEncoding = freshData.wireEncode();
cout << "Freshly-signed Data signature verification: " << (KeyChain::selfVerifyData(&freshEncoding->front(), freshEncoding->size()) ? "VERIFIED" : "FAILED") << endl;
- } catch (exception &e) {
+ } catch (exception& e) {
cout << "exception: " << e.what() << endl;
}
return 0;
diff --git a/tests/test-encode-decode-forwarding-entry.cpp b/tests/test-encode-decode-forwarding-entry.cpp
index 89a7a80..dfa780e 100644
--- a/tests/test-encode-decode-forwarding-entry.cpp
+++ b/tests/test-encode-decode-forwarding-entry.cpp
@@ -57,12 +57,12 @@
1
};
-static inline string toString(const vector<unsigned char> &v)
+static inline string toString(const vector<unsigned char>& v)
{
return string(&v[0], &v[0] + v.size());
}
-static void dumpForwardingEntry(const ForwardingEntry &forwardingEntry)
+static void dumpForwardingEntry(const ForwardingEntry& forwardingEntry)
{
cout << "action: " << forwardingEntry.getAction() << endl;
cout << "prefix: " << forwardingEntry.getPrefix().to_uri() << endl;
@@ -89,7 +89,7 @@
* Show the interest name and scope, and expect the name to have 4 components where the last component is a data packet
* whose content is a forwarding entry.
*/
-static void dumpInterestWithForwardingEntry(const Interest &interest)
+static void dumpInterestWithForwardingEntry(const Interest& interest)
{
if (interest.getName().getComponentCount() != 4) {
cout << "Error: expected the interest name to have 4 components. Got: " << interest.getName().to_uri() << endl;
@@ -129,7 +129,7 @@
reDecodedInterest.wireDecode(*encoding);
cout << "Re-decoded Interest:" << endl;
dumpInterestWithForwardingEntry(reDecodedInterest);
- } catch (exception &e) {
+ } catch (exception& e) {
cout << "exception: " << e.what() << endl;
}
return 0;
diff --git a/tests/test-encode-decode-interest.cpp b/tests/test-encode-decode-interest.cpp
index 26d8269..ad638ce 100644
--- a/tests/test-encode-decode-interest.cpp
+++ b/tests/test-encode-decode-interest.cpp
@@ -30,7 +30,7 @@
1
};
-static void dumpInterest(const Interest &interest)
+static void dumpInterest(const Interest& interest)
{
cout << "name: " << interest.getName().to_uri() << endl;
cout << "minSuffixComponents: ";
@@ -86,7 +86,7 @@
reDecodedInterest.wireDecode(*encoding);
cout << "Re-decoded Interest:" << endl;
dumpInterest(reDecodedInterest);
- } catch (exception &e) {
+ } catch (exception& e) {
cout << "exception: " << e.what() << endl;
}
return 0;
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index da02c81..3c55b31 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -24,7 +24,7 @@
callbackCount_ = 0;
}
- void onData(const ptr_lib::shared_ptr<const Interest> &interest, const ptr_lib::shared_ptr<Data> &data)
+ void onData(const ptr_lib::shared_ptr<const Interest>& interest, const ptr_lib::shared_ptr<Data>& data)
{
++callbackCount_;
cout << "Got data packet with name " << data->getName().to_uri() << endl;
@@ -33,7 +33,7 @@
cout << endl;
}
- void onTimeout(const ptr_lib::shared_ptr<const Interest> &interest)
+ void onTimeout(const ptr_lib::shared_ptr<const Interest>& interest)
{
++callbackCount_;
cout << "Time out for interest " << interest->getName().toUri() << endl;
@@ -69,7 +69,7 @@
// We need to sleep for a few milliseconds so we don't use 100% of the CPU.
usleep(10000);
}
- } catch (std::exception &e) {
+ } catch (std::exception& e) {
cout << "exception: " << e.what() << endl;
}
return 0;
diff --git a/tests/test-publish-async.cpp b/tests/test-publish-async.cpp
index 5358169..e28871c 100644
--- a/tests/test-publish-async.cpp
+++ b/tests/test-publish-async.cpp
@@ -23,7 +23,7 @@
}
void operator()
- (const ptr_lib::shared_ptr<const Name> &prefix, const ptr_lib::shared_ptr<const Interest> &interest, Transport &transport) {
+ (const ptr_lib::shared_ptr<const Name>& prefix, const ptr_lib::shared_ptr<const Interest>& interest, Transport& transport) {
++interestCount_;
// Make and sign a Data packet.
@@ -58,7 +58,7 @@
// We need to sleep for a few milliseconds so we don't use 100% of the CPU.
usleep(10000);
}
- } catch (std::exception &e) {
+ } catch (std::exception& e) {
cout << "exception: " << e.what() << endl;
}
return 0;