]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:talloc: Remove trailing spaces from testsuite.c
authorAndreas Schneider <asn@samba.org>
Tue, 6 Feb 2024 17:03:22 +0000 (18:03 +0100)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Sep 2024 00:11:34 +0000 (00:11 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
lib/talloc/testsuite.c

index 282ebc6956db29b2a23cefac22515f4a7c44fdef..6cdd3cddf5c9275af6946e1e16132e7e6d365d81 100644 (file)
@@ -1,14 +1,14 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    local testing of talloc routines.
 
    Copyright (C) Andrew Tridgell 2004
-   
+
      ** NOTE! The following LGPL license applies to the talloc
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -52,7 +52,7 @@ static struct timeval private_timeval_current(void)
 static double private_timeval_elapsed(struct timeval *tv)
 {
        struct timeval tv2 = private_timeval_current();
-       return (tv2.tv_sec - tv->tv_sec) + 
+       return (tv2.tv_sec - tv->tv_sec) +
               (tv2.tv_usec - tv->tv_usec)*1.0e-6;
 }
 
@@ -135,7 +135,7 @@ static void test_log_stdout(const char *message)
 }
 
 /*
-  test references 
+  test references
 */
 static bool test_ref1(void)
 {
@@ -150,7 +150,7 @@ static bool test_ref1(void)
        talloc_named_const(p1, 2, "x2");
        talloc_named_const(p1, 3, "x3");
 
-       r1 = talloc_named_const(root, 1, "r1"); 
+       r1 = talloc_named_const(root, 1, "r1");
        ref = talloc_reference(r1, p2);
        talloc_report_full(root, stderr);
 
@@ -192,7 +192,7 @@ static bool test_ref1(void)
 }
 
 /*
-  test references 
+  test references
 */
 static bool test_ref2(void)
 {
@@ -206,7 +206,7 @@ static bool test_ref2(void)
        talloc_named_const(p1, 1, "x3");
        p2 = talloc_named_const(p1, 1, "p2");
 
-       r1 = talloc_named_const(root, 1, "r1"); 
+       r1 = talloc_named_const(root, 1, "r1");
        ref = talloc_reference(r1, p2);
        talloc_report_full(root, stderr);
 
@@ -247,7 +247,7 @@ static bool test_ref2(void)
 }
 
 /*
-  test references 
+  test references
 */
 static bool test_ref3(void)
 {
@@ -287,7 +287,7 @@ static bool test_ref3(void)
 }
 
 /*
-  test references 
+  test references
 */
 static bool test_ref4(void)
 {
@@ -302,7 +302,7 @@ static bool test_ref4(void)
        talloc_named_const(p1, 1, "x3");
        p2 = talloc_named_const(p1, 1, "p2");
 
-       r1 = talloc_named_const(root, 1, "r1"); 
+       r1 = talloc_named_const(root, 1, "r1");
        ref = talloc_reference(r1, p2);
        talloc_report_full(root, stderr);
 
@@ -338,7 +338,7 @@ static bool test_ref4(void)
 
 
 /*
-  test references 
+  test references
 */
 static bool test_unlink1(void)
 {
@@ -353,7 +353,7 @@ static bool test_unlink1(void)
        talloc_named_const(p1, 1, "x3");
        p2 = talloc_named_const(p1, 1, "p2");
 
-       r1 = talloc_named_const(p1, 1, "r1");   
+       r1 = talloc_named_const(p1, 1, "r1");
        ref = talloc_reference(r1, p2);
        talloc_report_full(root, stderr);
 
@@ -439,11 +439,11 @@ static bool test_misc(void)
        CHECK_BLOCKS("misc", p1, 2);
        CHECK_BLOCKS("misc", root, 3);
 
-       torture_assert("misc", talloc_free(NULL) == -1, 
+       torture_assert("misc", talloc_free(NULL) == -1,
                                   "talloc_free(NULL) should give -1\n");
 
        talloc_set_destructor(p1, fail_destructor);
-       torture_assert("misc", talloc_free(p1) == -1, 
+       torture_assert("misc", talloc_free(p1) == -1,
                "Failed destructor should cause talloc_free to fail\n");
        talloc_set_destructor(p1, NULL);
 
@@ -458,10 +458,10 @@ static bool test_misc(void)
                "failed: strdup on NULL should give NULL\n");
 
        p2 = talloc_strndup(p1, "foo", 2);
-       torture_assert("misc", strcmp("fo", p2) == 0, 
+       torture_assert("misc", strcmp("fo", p2) == 0,
                                   "strndup doesn't work\n");
        p2 = talloc_asprintf_append_buffer(p2, "o%c", 'd');
-       torture_assert("misc", strcmp("food", p2) == 0, 
+       torture_assert("misc", strcmp("food", p2) == 0,
                                   "talloc_asprintf_append_buffer doesn't work\n");
        CHECK_BLOCKS("misc", p2, 1);
        CHECK_BLOCKS("misc", p1, 3);
@@ -634,7 +634,7 @@ static bool test_realloc_child(void)
        el1->list3 = talloc(el1, struct el2 *);
        el1->list3[0] = talloc(el1->list3, struct el2);
        el1->list3[0]->name = talloc_strdup(el1->list3[0], "testing2");
-       
+
        el2 = talloc(el1->list, struct el2);
        CHECK_PARENT("el2", el2, el1->list);
        el2_2 = talloc(el1->list2, struct el2);
@@ -742,7 +742,7 @@ static bool test_steal(void)
        talloc_steal(root, p2);
        CHECK_BLOCKS("steal", root, 2);
        CHECK_SIZE("steal", root, 20);
-       
+
        talloc_free(p2);
 
        CHECK_BLOCKS("steal", root, 1);
@@ -928,15 +928,15 @@ static bool test_speed(void)
 static bool test_lifeless(void)
 {
        void *top = talloc_new(NULL);
-       char *parent, *child; 
+       char *parent, *child;
        void *child_owner = talloc_new(NULL);
 
        printf("test: lifeless\n# TALLOC_UNLINK LOOP\n");
 
        parent = talloc_strdup(top, "parent");
-       child = talloc_strdup(parent, "child");  
+       child = talloc_strdup(parent, "child");
        (void)talloc_reference(child, parent);
-       (void)talloc_reference(child_owner, child); 
+       (void)talloc_reference(child_owner, child);
        talloc_report_full(top, stderr);
        talloc_unlink(top, parent);
        talloc_unlink(top, child);
@@ -969,7 +969,7 @@ static bool test_loop(void)
 
        parent = talloc_strdup(top, "parent");
        req1 = talloc(parent, struct req1);
-       req1->req2 = talloc_strdup(req1, "req2");  
+       req1->req2 = talloc_strdup(req1, "req2");
        talloc_set_destructor(req1->req2, test_loop_destructor);
        req1->req3 = talloc_strdup(req1, "req3");
        (void)talloc_reference(req1->req3, req1);
@@ -979,7 +979,7 @@ static bool test_loop(void)
        talloc_report_full(NULL, stderr);
        talloc_free(top);
 
-       torture_assert("loop", loop_destructor_count == 1, 
+       torture_assert("loop", loop_destructor_count == 1,
                                   "FAILED TO FIRE LOOP DESTRUCTOR\n");
        loop_destructor_count = 0;
 
@@ -2220,29 +2220,29 @@ bool torture_local_talloc(struct torture_context *tctx)
        test_reset();
        ret &= test_ref4();
        test_reset();
-       ret &= test_unlink1(); 
+       ret &= test_unlink1();
        test_reset();
        ret &= test_misc();
        test_reset();
        ret &= test_realloc();
        test_reset();
-       ret &= test_realloc_child(); 
+       ret &= test_realloc_child();
        test_reset();
-       ret &= test_steal(); 
+       ret &= test_steal();
        test_reset();
-       ret &= test_move(); 
+       ret &= test_move();
        test_reset();
        ret &= test_unref_reparent();
        test_reset();
-       ret &= test_realloc_fn(); 
+       ret &= test_realloc_fn();
        test_reset();
        ret &= test_type();
        test_reset();
-       ret &= test_lifeless(); 
+       ret &= test_lifeless();
        test_reset();
        ret &= test_loop();
        test_reset();
-       ret &= test_free_parent_deny_child(); 
+       ret &= test_free_parent_deny_child();
        test_reset();
        ret &= test_realloc_on_destructor_parent();
        test_reset();