summaryrefslogtreecommitdiff
path: root/runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc')
-rw-r--r--runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc b/runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc
index 6b3d6df82..7a409ab25 100644
--- a/runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc
+++ b/runtime/contrib/heap_trace/tests/src/valloc_interception_test.cc
@@ -18,8 +18,9 @@
#include "file_content_manipulations.h"
#include "trace.h"
+#include "symbol_searcher.h"
+#include "memory_pool_for_symbol_searcher_internals.h"
-#include <experimental/filesystem>
#include <limits>
extern std::unique_ptr<Trace> GlobalTrace;
@@ -70,4 +71,19 @@ TEST_F(VallocStub, must_not_do_the_record_about_allocation_event_if_original_fun
"GPU - Peak mem usage: 0 B, Total allocated: 0 B, Total deallocated: 0 B\n");
}
+TEST_F(VallocStub, should_allocate_memory_from_pool_for_symbol_searcher_internal_usage_if_need)
+{
+ signalizeThatNextAllocationsWillBeForSymbolSearcherInternalUsage();
+ void *p = valloc(1024);
+ signalizeThatSymbolSearcherEndedOfWork();
+ GlobalTrace.reset();
+
+ MemoryPoolForSymbolSearcherInternals pool;
+ ASSERT_TRUE(p);
+ ASSERT_TRUE(pool.containsMemorySpaceStartedFromPointer(p));
+ ASSERT_STREQ(getContentOfFile("./valloc_interception_test.log").c_str(),
+ "On CPU - Peak heap usage: 0 B, Total allocated: 0 B, Total deallocated: 0 B\nOn "
+ "GPU - Peak mem usage: 0 B, Total allocated: 0 B, Total deallocated: 0 B\n");
+}
+
} // namespace backstage