From 30169e876584a7214b9b9399d8b5907ba496ff40 Mon Sep 17 00:00:00 2001 From: Akshay Moghe Date: Fri, 30 Oct 2015 16:43:00 -0700 Subject: [PATCH] Attempt to use cmemory during go tests to detect leaks. --- crypt_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypt_test.go b/crypt_test.go index 071e874..cfd6d17 100644 --- a/crypt_test.go +++ b/crypt_test.go @@ -3,6 +3,8 @@ package crypt import ( "strings" "testing" + + "github.com/emilymaier/cmemory" ) func TestCryptSHA512(t *testing.T) { @@ -73,10 +75,12 @@ func TestCheckMemoryAllocation(t *testing.T) { niter = 512 ) + cmemory.StartInstrumentation() for i := 0; i < niter; i++ { h, _ := Crypt(pass, salt) _ = h } + cmemory.StopInstrumentation() // TODO: check all mem allocations are free'd }