func CheckXmlMemoryLeaks(t *testing.T) { help.LibxmlCleanUpParser() if !help.LibxmlCheckMemoryLeak() { t.Errorf("Memory leaks: %d!!!", help.LibxmlGetMemoryAllocation()) help.LibxmlReportMemoryLeak() } }
func CheckXmlMemoryLeaks(t *testing.T) { println("Cleaning up parser...") help.LibxmlCleanUpParser() println("Done cleaning parser, checking for libxml leaks...") if !help.LibxmlCheckMemoryLeak() { println("Found memory leaks!") t.Errorf("Memory leaks: %d!!!", help.LibxmlGetMemoryAllocation()) help.LibxmlReportMemoryLeak() } }
func CheckXmlMemoryLeaks(t *testing.T) { // LibxmlCleanUpParser() should only be called once during the lifetime of the // program, but because there's no way to know when the last test of the suite // runs in go, we can't accurately call it strictly once, so just avoid calling // it for now because it's known to cause crashes if called multiple times. //help.LibxmlCleanUpParser() if !help.LibxmlCheckMemoryLeak() { t.Errorf("Memory leaks: %d!!!", help.LibxmlGetMemoryAllocation()) help.LibxmlReportMemoryLeak() } }