+ ptr = rmr_trace_ref( NULL, NULL );
+ errors += fail_not_nil( ptr, "trace ref returned non-nil pointer when given nil message" );
+
+ mbuf = test_mk_msg( 2048, 0 ); // initially no trace size to force realloc
+ ptr = rmr_trace_ref( mbuf, NULL );
+ errors += fail_not_nil( ptr, "trace ref returned non-nil pointer when given a message without trace data" );
+
+ i = 100; // ensure that i is reset when there is no trace data
+ ptr = rmr_trace_ref( mbuf, &i );
+ errors += fail_not_nil( ptr, "trace ref returned non-nil pointer when given a message without trace data" );
+ errors += fail_not_equal( i, 0, "trace ref returned non zero size (a) when no trace info in message" );
+
+ i = 100;
+ mbuf = test_mk_msg( 2048, 113 ); // alloc with a trace data area
+ ptr = rmr_trace_ref( mbuf, &i );
+ errors += fail_if_nil( ptr, "trace ref returned nil pointer when given a message with trace data" );
+ errors += fail_not_equal( i, 113, "trace ref returned bad size (a), expected (b)" );
+