Loading...
tests/magazine_testing.h libmalloc-140.40.1 libmalloc-792.80.2
--- libmalloc/libmalloc-140.40.1/tests/magazine_testing.h
+++ libmalloc/libmalloc-792.80.2/tests/magazine_testing.h
@@ -29,11 +29,28 @@
 
 #import "../src/magazine_rack.c"
 
-boolean_t
-malloc_tracing_enabled = 0;
+bool
+malloc_tracing_enabled = false;
 
-// Stub out cross-file depedencies so that they just assert.
-void _malloc_printf(int flags, const char *fmt, ...)
+unsigned int
+ncpuclusters = 1;
+
+int
+recirc_retained_regions = DEFAULT_RECIRC_RETAINED_REGIONS;
+
+// Stub out cross-file dependencies so that they just assert.
+void malloc_report(uint32_t flags, const char *fmt, ...)
+{
+	__builtin_trap();
+}
+
+void
+malloc_zone_error(uint32_t flags, bool is_corruption, const char *fmt, ...)
+{
+	__builtin_trap();
+}
+void
+malloc_zone_check_fail(const char *msg, const char *fmt, ...)
 {
 	__builtin_trap();
 }
@@ -50,4 +67,12 @@
 	__builtin_trap();
 }
 
+void
+test_rack_setup(rack_t *rack, rack_type_t rack_type)
+{
+	memset(rack, 'a', sizeof(rack));
+	rack_init(rack, rack_type, 1, 0);
+	T_QUIET; T_ASSERT_NOTNULL(rack->magazines, "magazine initialisation");
+}
+
 #endif // __MAGAZINE_TESTING