From: Eric Ludlam Date: Sun, 27 Oct 2019 21:02:59 +0000 (-0400) Subject: * test/lisp/cedet/semantic-utest: silence compiler warnings X-Git-Tag: emacs-27.0.90~858 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38ec422a35ab6e6e295b56500bb11493cd39a10e;p=emacs.git * test/lisp/cedet/semantic-utest: silence compiler warnings * test/lisp/cedet/semantic-utest-c.el (semantic-test-c-preprocessor-simulation): Use with-current-buffer. * test/lisp/cedet/semantic-utest.el (semantic-utest-makebuffer): Use read-only-mode. (semantic-utest-verify-names-jave, semantic-utest-verify-names-2): Remove functions, unused. --- diff --git a/test/lisp/cedet/semantic-utest-c.el b/test/lisp/cedet/semantic-utest-c.el index a6a5fd16257..05f8491746d 100644 --- a/test/lisp/cedet/semantic-utest-c.el +++ b/test/lisp/cedet/semantic-utest-c.el @@ -49,13 +49,12 @@ (dolist (fp semantic-utest-c-comparisons) (let* ((semantic-lex-c-nested-namespace-ignore-second nil) (tags-actual - (save-excursion - (set-buffer (find-file-noselect (expand-file-name (car fp) semantic-utest-c-test-directory))) + (with-current-buffer + (find-file-noselect (expand-file-name (car fp) semantic-utest-c-test-directory)) (semantic-clear-toplevel-cache) (semantic-fetch-tags))) (tags-expected - (save-excursion - (set-buffer (find-file-noselect (expand-file-name (cdr fp) semantic-utest-c-test-directory))) + (with-current-buffer (find-file-noselect (expand-file-name (cdr fp) semantic-utest-c-test-directory)) (semantic-clear-toplevel-cache) (semantic-fetch-tags)))) (when (or (not tags-expected) (not tags-actual)) diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el index 7303c0ef092..2423e891756 100644 --- a/test/lisp/cedet/semantic-utest.el +++ b/test/lisp/cedet/semantic-utest.el @@ -492,7 +492,7 @@ Pre-fill the buffer with CONTENTS." (set-buffer buff) (setq buffer-offer-save nil) (font-lock-mode -1) ;; Font lock has issues in Emacs 23 - (toggle-read-only -1) ;; In case /tmp doesn't exist. + (read-only-mode -1) ;; In case /tmp doesn't exist (erase-buffer) (insert contents) ;(semantic-fetch-tags) ;JAVE could this go here? @@ -724,29 +724,6 @@ JAVE this thing would need to be recursive to handle java and csharp" (semantic-utest-taglists-equivalent-p table names skipnames) )) -;;;;;;;;;;;;;;;;;;;;;;;; -; JAVE redefine a new validation function -; is not quite as good as the old one yet -(defun semantic-utest-verify-names-jave (name-contents &optional skipnames) - "JAVE version of `semantic-utest-verify-names'. -NAME-CONTENTS is a sample of the tags buffer to test against. -SKIPNAMES is a list of names to remove from NAME-CONTENTS" - (assert (semantic-utest-verify-names-2 name-contents (semantic-fetch-tags)) - nil "failed test") -) - -(defun semantic-utest-verify-names-2 (l1 l2) - (cond ( (and (consp l1) (equal (car l1) 'overlay)) - (overlayp l2)) - ((not (consp l1)) - (equal l1 l2)) - ((consp l1) - (and (semantic-utest-verify-names-2 (car l1) (car l2)) (semantic-utest-verify-names-2 (cdr l1) (cdr l2)))) - (t (error "internal error")))) - - - - ;;; Kill indicator line ;;