From 3b307b3f1603ca6fb07f48066bb4552361e0e2a5 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sun, 15 Mar 2020 16:02:23 +0100 Subject: [PATCH] Remove old tests --- tests/foreign-bit-fields.scm | 51 ---------------------------- tests/foreign-record.log | 50 --------------------------- tests/foreign-record.scm | 66 ------------------------------------ 3 files changed, 167 deletions(-) delete mode 100644 tests/foreign-bit-fields.scm delete mode 100644 tests/foreign-record.log delete mode 100644 tests/foreign-record.scm diff --git a/tests/foreign-bit-fields.scm b/tests/foreign-bit-fields.scm deleted file mode 100644 index 581bea2..0000000 --- a/tests/foreign-bit-fields.scm +++ /dev/null @@ -1,51 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; This file is part of guile-irrlicht. -;;; -;;; Guile-irrlicht is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU Lesser General Public License as -;;; published by the Free Software Foundation; either version 3 of the -;;; License, or (at your option) any later version. -;;; -;;; Guile-irrlicht is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU Lesser General Public -;;; License along with guile-irrlicht. If not, see -;;; . - - -(use-modules (system foreign) - (srfi srfi-64) - (irrlicht util foreign)) - -(test-begin "foreign-bit-fields") - -;; Simple bit field group -(define bfg (bit-field-group (int8 2) (int8 3) (int8 1))) -(test-equal (get-bit-field-group-type bfg) - (list int8)) -(test-equal (make-c-bit-field-group bfg '(1 1 1)) - '(#b100101)) -(test-equal (parse-c-bit-field-group '(#b110011) bfg) - '(3 4 1)) - -;; Large bit field group -(define bfg (bit-field-group (int8 2) (int8 3) (int8 5))) -(test-equal (get-bit-field-group-type bfg) - (list int8 int8)) -(test-equal (make-c-bit-field-group bfg '(1 1 2)) - '(#b101 #b10)) -(test-equal (parse-c-bit-field-group '(#b10011 #b10) bfg) - '(3 4 2)) - -;; Structs with bit fields -(define types (list int8 (bit-field-group (int8 2) (int8 3) (int8 2)))) -(test-equal (sizeof+ types) 2) -(define values '(10 (2 4 3))) -(test-equal (parse-c-struct+ (make-c-struct+ types values) types) values) - -(test-end "foreign-bit-fields") diff --git a/tests/foreign-record.log b/tests/foreign-record.log deleted file mode 100644 index 3bb1448..0000000 --- a/tests/foreign-record.log +++ /dev/null @@ -1,50 +0,0 @@ -%%%% Starting test foreign-record -Group begin: foreign-record -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 36 - source-form: (test-assert (dimension2d? dim)) -Test end: - result-kind: pass - actual-value: #t -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 37 - source-form: (test-equal 10 (dimension2d-width dim)) -Test end: - result-kind: pass - actual-value: 10 - expected-value: 10 -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 38 - source-form: (test-equal 20 (dimension2d-height dim)) -Test end: - result-kind: pass - actual-value: 20 - expected-value: 20 -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 43 - source-form: (test-equal 50 (dimension2d-width dim)) -Test end: - result-kind: pass - actual-value: 50 - expected-value: 50 -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 44 - source-form: (test-equal 100 (dimension2d-height dim)) -Test end: - result-kind: pass - actual-value: 100 - expected-value: 100 -Test begin: - source-file: "tests/foreign-record.scm" - source-line: 47 - source-form: (test-assert (pointer? (foreign-record->pointer dim))) -Test end: - result-kind: pass - actual-value: #t -Group end: foreign-record -# of expected passes 6 diff --git a/tests/foreign-record.scm b/tests/foreign-record.scm deleted file mode 100644 index 9bc8dee..0000000 --- a/tests/foreign-record.scm +++ /dev/null @@ -1,66 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; This file is part of guile-irrlicht. -;;; -;;; Guile-irrlicht is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU Lesser General Public License as -;;; published by the Free Software Foundation; either version 3 of the -;;; License, or (at your option) any later version. -;;; -;;; Guile-irrlicht is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU Lesser General Public -;;; License along with guile-irrlicht. If not, see -;;; . - - -(use-modules (system foreign) - (srfi srfi-64) - (irrlicht util foreign)) - -(test-begin "foreign-record") - -;; Dimension 2D definition -(define-foreign-record-type dimension2d - (make-dimension2d width height) - dimension2d? - (width uint32 dimension2d-width set-dimension2d-width!) - (height uint32 dimension2d-height set-dimension2d-height!)) - -;; Create dimension -(define dim (make-dimension2d 10 20)) -(test-assert (dimension2d? dim)) -(test-equal 10 (dimension2d-width dim)) -(test-equal 20 (dimension2d-height dim)) - -;; Modify dimension -(set-dimension2d-width! dim 50) -(set-dimension2d-height! dim 100) -(test-equal 50 (dimension2d-width dim)) -(test-equal 100 (dimension2d-height dim)) - -;; Is a pointer -(test-assert (pointer? (foreign-record->pointer dim))) - -;; Foreign record types as types for other foreign records -(define-foreign-record-type point - (make-point x y) - point? - (x int64 point-x) - (y int64 point-y)) - -(define-foreign-record-type triangle - (make-triangle p1 p2 p3) - triangle? - (p1 point triangle-p1) - (p2 point triangle-p2) - (p3 point triangle-p3)) - -;(define tr (make-triangle (make-point 0 10) (make-point -10 5) (make-point 15 -7))) -;(test-equal -10 (point-x (triangle-p2 tr))) - -(test-end "foreign-record") -- 2.39.5