From 1a6ff60da8d824230e186a8c8bef8c21b23ae377 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 16 May 2012 00:04:07 +0200 Subject: coverage: Add test for applicable structs. * test-suite/tests/coverage.test ("procedure-execution-count")["applicable struct"]: New test. --- test-suite/tests/coverage.test | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test-suite/tests/coverage.test') diff --git a/test-suite/tests/coverage.test b/test-suite/tests/coverage.test index 4ac404344..b29de0f20 100644 --- a/test-suite/tests/coverage.test +++ b/test-suite/tests/coverage.test @@ -1,6 +1,6 @@ ;;;; coverage.test --- Code coverage. -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -216,6 +216,16 @@ (= 3 result) (not (procedure-execution-count data proc)))))) + (pass-if "applicable struct" + (let* (( (make-struct 0 'pw)) + (proc (lambda args (length args))) + (b (make-struct 0 proc))) + (let-values (((data result) + (with-code-coverage %test-vm b))) + (and (coverage-data? data) + (= 0 result) + (= (procedure-execution-count data proc) 1))))) + (pass-if "called from C" ;; The `scm_call_N' functions use the VM returned by `the-vm'. This ;; test makes sure that they get to use %TEST-VM. -- cgit v1.2.3