aboutsummaryrefslogtreecommitdiff
path: root/test/util.cpp
blob: e90882ade3d3cdf6d29165ff6a4823b59f6aad72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <gtest/gtest.h>

#include "backend/util.h"

TEST(Util, SafeFree) {
	char * str = static_cast<char *>(malloc(3));
	ASSERT_NE(str, nullptr);

	safe_free(&str);
	ASSERT_EQ(str, nullptr);

	// this shouldn't cause double free() error:
	safe_free(&str);
}