bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libgmp: new module


From: Bruno Haible
Subject: Re: [PATCH] libgmp: new module
Date: Sun, 12 Jul 2020 22:30:50 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; )

Paul Eggert wrote:
> --- /dev/null
> +++ b/tests/test-libgmp.c
> @@ -0,0 +1,24 @@
> +#include <config.h>
> +
> +#include <gmp.h>
> +
> +#include "macros.h"
> +
> +int
> +main ()
> +{
> +  /* A simple sanity check that 2 + 2 = 4.  */
> +  static mp_limb_t const twobody[] = { 2 };
> +  static mpz_t const two = MPZ_ROINIT_N ((mp_limb_t *) twobody, 1);
> +  ASSERT (mpz_fits_slong_p (two));
> +  ASSERT (mpz_get_si (two) == 2);
> +
> +  mpz_t four;
> +  mpz_init (four);
> +  mpz_add (four, two, two);
> +  ASSERT (mpz_fits_slong_p (four));
> +  ASSERT (mpz_get_si (four) == 4);
> +  mpz_clear (four);
> +
> +  return 0;
> +}
> 

This file is longer than 10 lines and apparently hand-written; therefore it
needs a copyright header.


diff --git a/tests/test-libgmp.c b/tests/test-libgmp.c
index af8e4d7..f72a74c 100644
--- a/tests/test-libgmp.c
+++ b/tests/test-libgmp.c
@@ -1,3 +1,19 @@
+/* Test of libgmp or its mini-gmp substitute.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   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 3 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 <https://www.gnu.org/licenses/>.  */
+
 #include <config.h>
 
 #include <gmp.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]