summaryrefslogtreecommitdiffstats
path: root/vespamalloc/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-10 21:21:54 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-10 21:44:07 +0000
commit626d0f456c3b678a8cc247ec76b3ad9a63dff7fb (patch)
tree7f48e58f66985e2fb20eddb5e75fac931f952807 /vespamalloc/src/tests
parentb35ecd28e9f90b12ac95f48f71e71d827230a472 (diff)
Remove template argument
Diffstat (limited to 'vespamalloc/src/tests')
-rw-r--r--vespamalloc/src/tests/allocfree/linklist.cpp26
-rw-r--r--vespamalloc/src/tests/test2/testgraph.cpp4
2 files changed, 15 insertions, 15 deletions
diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp
index ea6eab44555..1bffb76b2ee 100644
--- a/vespamalloc/src/tests/allocfree/linklist.cpp
+++ b/vespamalloc/src/tests/allocfree/linklist.cpp
@@ -20,18 +20,18 @@ template <size_t MinSizeClassC, size_t MaxSizeClassMultiAllocC>
class MemBlockT : public vespamalloc::CommonT<MinSizeClassC>
{
public:
- typedef vespamalloc::StackEntry<vespamalloc::StackReturnEntry> Stack;
+ typedef vespamalloc::StackEntry Stack;
enum {
MaxSizeClassMultiAlloc = MaxSizeClassMultiAllocC,
SizeClassSpan = (MaxSizeClassMultiAllocC-MinSizeClassC)
};
- MemBlockT() : _ptr(NULL) { }
+ MemBlockT() : _ptr(nullptr) { }
MemBlockT(void * p) : _ptr(p) { }
MemBlockT(void * p, size_t /*sz*/) : _ptr(p) { }
void *ptr() { return _ptr; }
const void *ptr() const { return _ptr; }
- bool validAlloc() const { return _ptr != NULL; }
- bool validFree() const { return _ptr != NULL; }
+ bool validAlloc() const { return _ptr != nullptr; }
+ bool validFree() const { return _ptr != nullptr; }
void setExact(size_t ) { }
void alloc(bool ) { }
void threadId(int ) { }
@@ -40,7 +40,7 @@ public:
bool allocated() const { return false; }
int threadId() const { return 0; }
void info(FILE *, unsigned level=0) const { (void) level; }
- Stack * callStack() { return NULL; }
+ Stack * callStack() { return nullptr; }
size_t callStackLen() const { return 0; }
static size_t adjustSize(size_t sz) { return sz; }
@@ -138,7 +138,7 @@ int Test::Main() {
ASSERT_TRUE((l >= &globalList[0]) && (l < &globalList[NumBlocks]));
}
List *n = List::linkOut(sharedList);
- ASSERT_TRUE(n == NULL);
+ ASSERT_TRUE(n == nullptr);
List::HeadPtr tmp(sharedList.load());
tmp._tag = 1;
@@ -156,12 +156,12 @@ int Test::Main() {
LinkInOutAndIn pc1(sharedList, 16, false);
LinkInOutAndIn pc2(sharedList, 16, true);
- ASSERT_TRUE(pool.NewThread(&c1, NULL) != NULL);
- ASSERT_TRUE(pool.NewThread(&c2, NULL) != NULL);
- ASSERT_TRUE(pool.NewThread(&p1, NULL) != NULL);
- ASSERT_TRUE(pool.NewThread(&p2, NULL) != NULL);
- ASSERT_TRUE(pool.NewThread(&pc1, NULL) != NULL);
- ASSERT_TRUE(pool.NewThread(&pc2, NULL) != NULL);
+ ASSERT_TRUE(pool.NewThread(&c1, nullptr) != nullptr);
+ ASSERT_TRUE(pool.NewThread(&c2, nullptr) != nullptr);
+ ASSERT_TRUE(pool.NewThread(&p1, nullptr) != nullptr);
+ ASSERT_TRUE(pool.NewThread(&p2, nullptr) != nullptr);
+ ASSERT_TRUE(pool.NewThread(&pc1, nullptr) != nullptr);
+ ASSERT_TRUE(pool.NewThread(&pc2, nullptr) != nullptr);
for (; duration > 0; --duration) {
LOG(info, "%d seconds left...", duration);
@@ -182,6 +182,6 @@ int Test::Main() {
ASSERT_TRUE((l >= &globalList[0]) && (l < &globalList[NumBlocks]));
}
n = List::linkOut(sharedList);
- ASSERT_TRUE(n == NULL);
+ ASSERT_TRUE(n == nullptr);
TEST_DONE();
}
diff --git a/vespamalloc/src/tests/test2/testgraph.cpp b/vespamalloc/src/tests/test2/testgraph.cpp
index 9aa3020f0be..7a79756f7fb 100644
--- a/vespamalloc/src/tests/test2/testgraph.cpp
+++ b/vespamalloc/src/tests/test2/testgraph.cpp
@@ -23,7 +23,7 @@ public:
asciistream os;
os << ' ' << node;
_string += os.c_str();
- if (node.callers() == NULL) {
+ if (node.callers() == nullptr) {
printf("%s\n", _string.c_str());
}
}
@@ -75,7 +75,7 @@ void testaggregator() {
callGraph.addStack(s4, 3);
Aggregator agg;
DumpGraph<CallGraphT::Node> dump(&agg, "{ ", " }");
- callGraph.traverseDepth(dump);;
+ callGraph.traverseDepth(dump);
asciistream ost;
ost << agg;
printf("%s\n", ost.c_str());