[Openvpn-devel] Remove BUFFER_LIST_AGGREGATE_TEST test code

Message ID 20220101160632.2250072-1-arne@rfc2549.org
State Accepted
Headers show
Series
  • [Openvpn-devel] Remove BUFFER_LIST_AGGREGATE_TEST test code
Related show

Commit Message

Arne Schwabe Jan. 1, 2022, 4:06 p.m.
This code has been dead for years and also does not seem that
useful anymore since we already have a proper unit_test for the
buffer code.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 src/openvpn/init.c | 64 ----------------------------------------------
 1 file changed, 64 deletions(-)

Comments

Gert Doering Jan. 14, 2022, 5:22 p.m. | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

That was an easy one... "only remove things, between an #ifdef..#endif
which nobody has ever enabled in the last 10 years" :-)

Your patch has been applied to the master branch.

commit 3272a04a36aabea6885c75c65dbb2d141676f652
Author: Arne Schwabe
Date:   Sat Jan 1 17:06:32 2022 +0100

     Remove BUFFER_LIST_AGGREGATE_TEST test code

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220101160632.2250072-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23492.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index e8723714..4e37b885 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -870,70 +870,6 @@  init_static(void)
     return false;
 #endif
 
-#ifdef BUFFER_LIST_AGGREGATE_TEST
-    /* test buffer_list_aggregate function */
-    {
-        static const char *text[] = {
-            "It was a bright cold day in April, ",
-            "and the clocks were striking ",
-            "thirteen. ",
-            "Winston Smith, ",
-            "his chin nuzzled into his breast in an ",
-            "effort to escape the vile wind, ",
-            "slipped quickly through the glass doors ",
-            "of Victory Mansions, though not quickly ",
-            "enough to prevent a swirl of gritty dust from ",
-            "entering along with him."
-        };
-
-        int iter, listcap;
-        for (listcap = 0; listcap < 12; ++listcap)
-        {
-            for (iter = 0; iter < 512; ++iter)
-            {
-                struct buffer_list *bl = buffer_list_new(listcap);
-                {
-                    int i;
-                    for (i = 0; i < SIZE(text); ++i)
-                    {
-                        buffer_list_push(bl, (unsigned char *)text[i]);
-                    }
-                }
-                printf("[cap=%d i=%d] *************************\n", listcap, iter);
-                if (!(iter & 8))
-                {
-                    buffer_list_aggregate(bl, iter/2);
-                }
-                if (!(iter & 16))
-                {
-                    buffer_list_push(bl, (unsigned char *)"Even more text...");
-                }
-                buffer_list_aggregate(bl, iter);
-                if (!(iter & 1))
-                {
-                    buffer_list_push(bl, (unsigned char *)"More text...");
-                }
-                {
-                    struct buffer *buf;
-                    while ((buf = buffer_list_peek(bl)))
-                    {
-                        int c;
-                        printf("'");
-                        while ((c = buf_read_u8(buf)) >= 0)
-                        {
-                            putchar(c);
-                        }
-                        printf("'\n");
-                        buffer_list_advance(bl, 0);
-                    }
-                }
-                buffer_list_free(bl);
-            }
-        }
-        return false;
-    }
-#endif /* ifdef BUFFER_LIST_AGGREGATE_TEST */
-
 #ifdef MSTATS_TEST
     {
         int i;