]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/lisp/cedet/semantic-utest: silence compiler warnings
authorEric Ludlam <ericludlam@gmail.com>
Sun, 27 Oct 2019 21:02:59 +0000 (17:02 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 27 Oct 2019 21:02:59 +0000 (17:02 -0400)
* 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.

test/lisp/cedet/semantic-utest-c.el
test/lisp/cedet/semantic-utest.el

index a6a5fd162570da4b5b3cf052faafee663fc0f21b..05f8491746d4b53bd4d39813ac3b922a6e804bd5 100644 (file)
   (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))
index 7303c0ef09273ce2aafe703c40527348f5897547..2423e8917563b2aed87ae380ceb52f0b0b772e20 100644 (file)
@@ -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
 ;;