Commit 7d323f07 authored by Basil L. Contovounesios's avatar Basil L. Contovounesios

Silence some byte-compiler warnings in tests

* test/lisp/emacs-lisp/cl-generic-tests.el:
* test/lisp/progmodes/elisp-mode-tests.el: Declare functions
referred to within macroexpansions.
(xref-elisp-overloadable-no-default)
(xref-elisp-overloadable-co-located-default)
(xref-elisp-overloadable-separate-default): Prefix unused arguments
with underscore.

* test/lisp/international/ccl-tests.el:
* test/lisp/wdired-tests.el:
* test/lisp/emacs-lisp/package-tests.el: Declare functions used.
(package-test-update-archives, package-test-signed): Use
revert-buffer in place of its obsolete alias package-menu-refresh.

* test/lisp/eshell/eshell-tests.el:
* test/lisp/mail/footnote-tests.el:
* test/src/buffer-tests.el: Require dependencies used.

* test/lisp/image/exif-tests.el: Remove unneeded (require 'seq).
(test-exit-direct-ascii-value): Actually perform the test.
* test/lisp/progmodes/sql-tests.el (sql-test-add-existing-product):
Fix typo.

* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
* test/src/data-tests.el (test-bool-vector-bv-from-hex-string)
(test-bool-vector-apply-mock-op): Remove unused local variables.
parent cf473e74
Pipeline #5749 passed with stage
in 61 minutes and 25 seconds
......@@ -23,9 +23,15 @@
;;; Code:
(eval-when-compile (require 'ert)) ;Don't indirectly require cl-lib at run-time.
(require 'cl-generic)
;; Don't indirectly require `cl-lib' at run-time.
(eval-when-compile (require 'ert))
(declare-function ert--should-signal-hook "ert")
(declare-function ert--signal-should-execution "ert")
(declare-function ert-fail "ert")
(declare-function ert-set-test "ert")
(fmakunbound 'cl--generic-1)
(cl-defgeneric cl--generic-1 (x y))
(cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.")
......
......@@ -267,6 +267,9 @@ Must called from within a `tar-mode' buffer."
(should (package-installed-p 'simple-single))
(should (package-installed-p 'simple-depend))))
(declare-function macro-problem-func "macro-problem" ())
(declare-function macro-problem-10-and-90 "macro-problem" ())
(ert-deftest package-test-macro-compilation ()
"Install a package which includes a dependency."
(with-package-test (:basedir "package-resources")
......@@ -391,7 +394,7 @@ Must called from within a `tar-mode' buffer."
"Test updating package archives."
(with-package-test ()
(let ((buf (package-list-packages)))
(package-menu-refresh)
(revert-buffer)
(search-forward-regexp "^ +simple-single")
(package-menu-mark-install)
(package-menu-execute)
......@@ -399,7 +402,7 @@ Must called from within a `tar-mode' buffer."
(let ((package-test-data-dir
(expand-file-name "package-resources/newer-versions" package-test-file-dir)))
(setq package-archives `(("gnu" . ,package-test-data-dir)))
(package-menu-refresh)
(revert-buffer)
;; New version should be available and old version should be installed
(goto-char (point-min))
......@@ -411,7 +414,7 @@ Must called from within a `tar-mode' buffer."
(package-menu-mark-upgrades)
(package-menu-execute)
(package-menu-refresh)
(revert-buffer)
(should (package-installed-p 'simple-single '(1 4)))))))
(ert-deftest package-test-update-archives-async ()
......@@ -541,6 +544,8 @@ Must called from within a `tar-mode' buffer."
(let ((process-environment
(cons (concat "HOME=" homedir)
process-environment)))
(require 'epg-config)
(defvar epg-config--program-alist)
(epg-find-configuration
'OpenPGP nil
;; By default we require gpg2 2.1+ due to some
......@@ -573,7 +578,7 @@ Must called from within a `tar-mode' buffer."
(should (progn (package-install 'signed-bad) 'noerror)))
;; Check if the installed package status is updated.
(let ((buf (package-list-packages)))
(package-menu-refresh)
(revert-buffer)
(should (re-search-forward
"^\\s-+signed-good\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-"
nil t))
......
......@@ -26,6 +26,7 @@
;;; Code:
(require 'ert)
(require 'esh-mode)
(require 'eshell)
(defmacro with-temp-eshell (&rest body)
......
......@@ -21,7 +21,6 @@
(require 'ert)
(require 'exif)
(require 'seq)
(defun test-image-file (name)
(expand-file-name
......@@ -49,7 +48,7 @@
(should (equal (exif-elem exif 'artist) "z"))))
(ert-deftest test-exit-direct-ascii-value ()
(equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0))
(equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0)))
(should (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)))
(should (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))))
;;; exif-tests.el ends here
......@@ -94,6 +94,9 @@ At EOF:
(ccl-dump prog-pgg-code)
(should (equal (buffer-string) prog-pgg-dump))))
(defvar pgg-parse-crc24)
(declare-function pgg-parse-crc24-string "pgg-parse" (string))
(ert-deftest pgg-parse-crc24 ()
;; Compiler
(require 'pgg)
......
......@@ -18,12 +18,10 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'footnote)
(ert-deftest footnote-tests-same-place ()
(with-temp-buffer
(footnote-mode 1)
......
......@@ -598,16 +598,17 @@ to (xref-elisp-test-descr-to-target xref)."
;; Define some mode-local overloadable/overridden functions for xref to find
(require 'mode-local)
(declare-function xref-elisp-overloadable-no-methods-default "elisp-mode-tests")
(declare-function xref-elisp-overloadable-no-default-default "elisp-mode-tests")
(define-overloadable-function xref-elisp-overloadable-no-methods ()
"doc string overloadable no-methods")
(define-overloadable-function xref-elisp-overloadable-no-default ()
"doc string overloadable no-default")
;; FIXME: byte compiler complains about unused lexical arguments
;; generated by this macro.
(define-mode-local-override xref-elisp-overloadable-no-default c-mode
(start end &optional nonterminal depth returnonerror)
(_start _end &optional _nonterminal _depth _returnonerror)
"doc string overloadable no-default c-mode."
"result overloadable no-default c-mode.")
......@@ -616,7 +617,7 @@ to (xref-elisp-test-descr-to-target xref)."
"result overloadable co-located-default.")
(define-mode-local-override xref-elisp-overloadable-co-located-default c-mode
(start end &optional nonterminal depth returnonerror)
(_start _end &optional _nonterminal _depth _returnonerror)
"doc string overloadable co-located-default c-mode."
"result overloadable co-located-default c-mode.")
......@@ -628,7 +629,7 @@ to (xref-elisp-test-descr-to-target xref)."
"result overloadable separate-default.")
(define-mode-local-override xref-elisp-overloadable-separate-default c-mode
(start end &optional nonterminal depth returnonerror)
(_start _end &optional _nonterminal _depth _returnonerror)
"doc string overloadable separate-default c-mode."
"result overloadable separate-default c-mode.")
......
......@@ -193,7 +193,7 @@ Perform ACTION and validate results"
"Add a product that already exists."
(sql-test-product-feature-harness
(should-error (sql-add-feature 'a "Aaa"))
(should-error (sql-add-product 'a "Aaa"))
(should (equal (pp-to-string (assoc 'a sql-product-alist))
"(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n"))))
......
......@@ -716,8 +716,7 @@ See Bug#21722."
(defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body)
(declare (debug (sexp form body)) (indent 2))
(let ((expected (make-symbol "expected"))
(command (make-symbol "command"))
(let ((command (make-symbol "command"))
(caller-buf (make-symbol "caller-buf"))
(output-buf (make-symbol "output-buf")))
`(let* ((,caller-buf (generate-new-buffer "caller-buf"))
......
......@@ -129,6 +129,8 @@ wdired-mode."
(delete-directory test-dir t)))))
(defvar server-socket-dir)
(declare-function dired-smart-shell-command "dired-x"
(command &optional output-buffer error-buffer))
(ert-deftest wdired-test-bug34915 ()
"Test editing when dired-listing-switches includes -F.
......
......@@ -20,6 +20,7 @@
;;; Code:
(require 'ert)
(require 'seq)
(eval-when-compile (require 'cl-lib))
(ert-deftest overlay-modification-hooks-message-other-buf ()
......
......@@ -174,7 +174,7 @@ most-positive-fixnum, which is just less than a power of 2.")
sum 1))
(defun test-bool-vector-bv-from-hex-string (desc)
(let (bv nchars nibbles)
(let (bv nibbles)
(dolist (c (string-to-list desc))
(push (string-to-number
(char-to-string c)
......@@ -244,9 +244,9 @@ comparing the subr with a much slower lisp implementation."
(defun test-bool-vector-apply-mock-op (mock a b c)
"Compute (slowly) the correct result of a bool-vector set operation."
(let (changed nv)
(let (changed)
(cl-assert (eql (length b) (length c)))
(if a (setf nv a)
(unless a
(setf a (make-bool-vector (length b) nil))
(setf changed t))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment