Fix lint errors
This commit is contained in:
parent
5c32905944
commit
52e04a395b
1 changed files with 5 additions and 4 deletions
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "tracetools/utils.hpp"
|
#include "tracetools/utils.hpp"
|
||||||
#include "test_utils.hpp"
|
|
||||||
|
|
||||||
class SomeClassWithCallback
|
class SomeClassWithCallback
|
||||||
{
|
{
|
||||||
|
@ -45,13 +45,14 @@ TEST(TestUtils, valid_address_symbol) {
|
||||||
std::function<void(std::shared_ptr<int>)> f = &function_shared;
|
std::function<void(std::shared_ptr<int>)> f = &function_shared;
|
||||||
// Address for one with an actual underlying function should be non-zero
|
// Address for one with an actual underlying function should be non-zero
|
||||||
ASSERT_GT(get_address(f), (void *)0) << "get_address() for function not valid";
|
ASSERT_GT(get_address(f), (void *)0) << "get_address() for function not valid";
|
||||||
ASSERT_STREQ(get_symbol(get_address(f)), "function_shared(std::shared_ptr<int>)") << "invalid function name";
|
ASSERT_STREQ(get_symbol(get_address(f)), "function_shared(std::shared_ptr<int>)") <<
|
||||||
|
"invalid function name";
|
||||||
|
|
||||||
// Lambda
|
// Lambda
|
||||||
std::function<int(int)> l = [](int num) {return num + 1;};
|
std::function<int(int)> l = [](int num) {return num + 1;};
|
||||||
// Address for an std::function with an underlying lambda should be nullptr
|
// Address for an std::function with an underlying lambda should be nullptr
|
||||||
ASSERT_EQ(get_address(l), nullptr) << "get_address() for lambda std::function not 0";
|
ASSERT_EQ(get_address(l), nullptr) << "get_address() for lambda std::function not 0";
|
||||||
// TODO symbol
|
// TODO(christophebedard) check symbol
|
||||||
|
|
||||||
// Bind (to member function)
|
// Bind (to member function)
|
||||||
SomeClassWithCallback scwc;
|
SomeClassWithCallback scwc;
|
||||||
|
@ -62,5 +63,5 @@ TEST(TestUtils, valid_address_symbol) {
|
||||||
std::placeholders::_2
|
std::placeholders::_2
|
||||||
);
|
);
|
||||||
ASSERT_EQ(get_address(fscwc), nullptr) << "get_address() for std::bind std::function not 0";
|
ASSERT_EQ(get_address(fscwc), nullptr) << "get_address() for std::bind std::function not 0";
|
||||||
// TODO symbol
|
// TODO(christophebedard) check symbol
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue