From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.bugs Subject: bug#25351: 26.0.50; Testcover doesn't work on code that creates simple lists and modifies them Date: Tue, 03 Jan 2017 19:06:17 -0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1483499238 29392 195.159.176.226 (4 Jan 2017 03:07:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2017 03:07:18 +0000 (UTC) To: 25351@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 04 04:07:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cObuu-0006We-PP for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jan 2017 04:07:08 +0100 Original-Received: from localhost ([::1]:37046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cObuy-0006tn-UI for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jan 2017 22:07:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cObut-0006tT-6w for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cObuo-0000kD-Ah for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:07:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53529) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cObuo-0000k0-7z for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cObun-0002JF-Vs for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jan 2017 03:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25351 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14834992028849 (code B ref -1); Wed, 04 Jan 2017 03:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jan 2017 03:06:42 +0000 Original-Received: from localhost ([127.0.0.1]:40695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cObuT-0002If-Pt for submit@debbugs.gnu.org; Tue, 03 Jan 2017 22:06:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cObuR-0002IT-Vp for submit@debbugs.gnu.org; Tue, 03 Jan 2017 22:06:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cObuM-0000c7-1C for submit@debbugs.gnu.org; Tue, 03 Jan 2017 22:06:34 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cObuL-0000c3-UM for submit@debbugs.gnu.org; Tue, 03 Jan 2017 22:06:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cObuI-0006lh-8J for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:06:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cObuD-0000Yh-7z for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:06:30 -0500 Original-Received: from aibo.runbox.com ([91.220.196.211]:43220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cObuD-0000XU-0g for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2017 22:06:25 -0500 Original-Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1cObuA-0006Cx-U4 for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 04:06:22 +0100 Original-Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront11.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1cObu7-0001bE-Ob for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 04:06:20 +0100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127724 Archived-At: Testcover marks forms which have only returned a single value while under code coverage with a tan splotch to indicate insufficient test coverage, It also identifies forms which will only ever return a single value and suppresses the splotch on those. During the coverage run, it saves a reference to the return value of those single value forms, and the next time the form is evaluated, it uses `equal' to determine if the value has changed, and if it has, Testcover reports an error. The problem with this is that it is a common idiom to create a data structure using an expression that always returns the same thing, and then modify it later. Since Testcover keeps a reference not a copy, it ends up with a reference to a modified object, which fails the comparison with the next return value of the same expression. For example: (defun my-blank-record () (list (list 'name) (list 'age))) (defun my-make-record (name age) (let ((rec (my-blank-record))) (setf (cdr (assq 'name rec)) name) (setf (cdr (assq 'age rec)) age) rec)) (my-make-record "Jack" 10) (my-make-record "Jill" 12) To reproduce this problem, save the above code in a file called bug.el, and then: M-x testcover-start RET bug.el RET The result will be testcover-1value's "Value of form marked with =E2=80=981value=E2=80=99 does vary" error.