From 525c70c0b23df2d6f80130c90e4bb3a1073f5518 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Thu, 18 Nov 2021 14:27:30 +0800 Subject: [PATCH] refactor (test_utils)!: separate file for memory check functions Memory check (leaks and heap tracing) functions for unit tests now have a separate file now and are renamed for more consistency. BREAKING CHANGE: renamed memory check function names which may be used in unit tests outside IDF. * Original commit: espressif/esp-idf@16514f93f06cd833306459d615458536a9f2e5cd --- .../test/test_websocket_client.c | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/components/esp_websocket_client/test/test_websocket_client.c b/components/esp_websocket_client/test/test_websocket_client.c index 5d96b4983..1c9e895a3 100644 --- a/components/esp_websocket_client/test/test_websocket_client.c +++ b/components/esp_websocket_client/test/test_websocket_client.c @@ -1,28 +1,26 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + * + * This test code is in the Public Domain (or CC0 licensed, at your option.) + * + * Unless required by applicable law or agreed to in writing, this + * software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. + */ #include #include #include #include "unity.h" -#include "test_utils.h" +#include "memory_checks.h" static void test_leak_setup(const char * file, long line) { printf("%s:%ld\n", file, line); - unity_reset_leak_checks(); + test_utils_record_free_mem(); } TEST_CASE("websocket init and deinit", "[websocket][leaks=0]")