From: Richard Russon Date: Wed, 1 May 2019 15:05:48 +0000 (+0100) Subject: test: move buffer tests X-Git-Tag: 2019-10-25~228^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db02008e9088c748d0b5c50ae8dba065cd81cb83;p=neomutt test: move buffer tests --- diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index 3d03db138..0157724fb 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -1,5 +1,4 @@ TEST_OBJS = test/main.o \ - test/buffer.o ADDRESS_OBJS = test/address/main.o \ test/address/mutt_addr_append.o \ diff --git a/test/buffer.c b/test/buffer.c deleted file mode 100644 index 74e69cf03..000000000 --- a/test/buffer.c +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file - * Test code for Buffers - * - * @authors - * Copyright (C) 2019 Richard Russon - * - * @copyright - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -#define TEST_NO_MAIN -#include "acutest.h" -#include "config.h" -#include "mutt/mutt.h" - -void test_mutt_buffer_concat_path(void) -{ - // void mutt_buffer_concat_path(struct Buffer *buf, const char *dir, const char *fname) - - { - mutt_buffer_concat_path(NULL, "apple", "banana"); - TEST_CHECK_(1, "mutt_buffer_concat_path(NULL, \"apple\", \"banana\")"); - } - - { - struct Buffer buf = { 0 }; - mutt_buffer_concat_path(&buf, NULL, "banana"); - TEST_CHECK_(1, "mutt_buffer_concat_path(&buf, NULL, \"banana\")"); - } - - { - struct Buffer buf = { 0 }; - mutt_buffer_concat_path(&buf, "apple", NULL); - TEST_CHECK_(1, "mutt_buffer_concat_path(&buf, \"apple\", NULL)"); - } - - { - struct Buffer *buf = mutt_buffer_new(); - mutt_buffer_concat_path(buf, "apple", "banana"); - TEST_CHECK(strcmp(mutt_b2s(buf), "apple/banana") == 0); - mutt_buffer_free(&buf); - } -} diff --git a/test/buffer/mutt_buffer_concat_path.c b/test/buffer/mutt_buffer_concat_path.c index c52d5d247..061d8d57d 100644 --- a/test/buffer/mutt_buffer_concat_path.c +++ b/test/buffer/mutt_buffer_concat_path.c @@ -45,4 +45,11 @@ void test_mutt_buffer_concat_path(void) mutt_buffer_concat_path(&buf, "apple", NULL); TEST_CHECK_(1, "mutt_buffer_concat_path(&buf, \"apple\", NULL)"); } + + { + struct Buffer *buf = mutt_buffer_new(); + mutt_buffer_concat_path(buf, "apple", "banana"); + TEST_CHECK(strcmp(mutt_b2s(buf), "apple/banana") == 0); + mutt_buffer_free(&buf); + } } diff --git a/test/main.c b/test/main.c index d5ba2eec7..8219aac4d 100644 --- a/test/main.c +++ b/test/main.c @@ -26,7 +26,6 @@ * Add your test cases to this list. *****************************************************************************/ #define NEOMUTT_TEST_LIST \ - NEOMUTT_TEST_ITEM(test_mutt_buffer_concat_path) \ /****************************************************************************** * You probably don't need to touch what follows.