From cd6a6bb5c105fdc7a4af2ba26604e18e66892f2f Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 6 Jul 2019 23:11:47 -0400 Subject: [PATCH 1/5] fbc-tests: enable old vararg tests only if -gen gas --- inc/crt/stdarg.bi | 2 +- tests/functions/va_int_and_ptrs.bas | 6 +----- tests/functions/va_strings.bas | 6 +----- tests/functions/va_tmpstring.bas | 6 +----- tests/functions/var_args.bas | 6 +----- 5 files changed, 5 insertions(+), 21 deletions(-) diff --git a/inc/crt/stdarg.bi b/inc/crt/stdarg.bi index 10b174fe40..29a43d3901 100644 --- a/inc/crt/stdarg.bi +++ b/inc/crt/stdarg.bi @@ -9,6 +9,6 @@ #ifndef __crt_stdarg_bi__ #define __crt_stdarg_bi__ -type va_list as any ptr +type va_list as cva_list #endif diff --git a/tests/functions/va_int_and_ptrs.bas b/tests/functions/va_int_and_ptrs.bas index b01585774c..9778f4820c 100644 --- a/tests/functions/va_int_and_ptrs.bas +++ b/tests/functions/va_int_and_ptrs.bas @@ -1,10 +1,6 @@ # include "fbcunit.bi" -#if defined( __FB_64BIT__ ) - #if defined( __FB_WIN32__ ) - #define DOTEST - #endif -#elseif (__FB_BACKEND__ = "gas") +#if (__FB_BACKEND__ = "gas") #define DOTEST #endif diff --git a/tests/functions/va_strings.bas b/tests/functions/va_strings.bas index da06e5baa0..d68d2698b4 100644 --- a/tests/functions/va_strings.bas +++ b/tests/functions/va_strings.bas @@ -1,10 +1,6 @@ # include "fbcunit.bi" -#if defined( __FB_64BIT__ ) - #if defined( __FB_WIN32__ ) - #define DOTEST - #endif -#elseif (__FB_BACKEND__ = "gas") +#if (__FB_BACKEND__ = "gas") #define DOTEST #endif diff --git a/tests/functions/va_tmpstring.bas b/tests/functions/va_tmpstring.bas index 27aa3757fd..776ad1d44d 100644 --- a/tests/functions/va_tmpstring.bas +++ b/tests/functions/va_tmpstring.bas @@ -1,10 +1,6 @@ # include "fbcunit.bi" -#if defined( __FB_64BIT__ ) - #if defined( __FB_WIN32__ ) - #define DOTEST - #endif -#elseif (__FB_BACKEND__ = "gas") +#if (__FB_BACKEND__ = "gas") #define DOTEST #endif diff --git a/tests/functions/var_args.bas b/tests/functions/var_args.bas index c35a5252ce..1f3bfe9aff 100644 --- a/tests/functions/var_args.bas +++ b/tests/functions/var_args.bas @@ -1,10 +1,6 @@ # include "fbcunit.bi" -#if defined( __FB_64BIT__ ) - #if defined( __FB_WIN32__ ) - #define DOTEST - #endif -#elseif (__FB_BACKEND__ = "gas") +#if (__FB_BACKEND__ = "gas") #define DOTEST #endif From 6b61ea507bf84753d8063214a47debb6a710f212 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 13 Jul 2019 19:56:59 -0400 Subject: [PATCH 2/5] fbc-tests: tests/wstring/print.bas: remove test for whitespace with input #, it can't work --- tests/wstring/print.bas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wstring/print.bas b/tests/wstring/print.bas index 4baf36a3e4..17701f70a2 100644 --- a/tests/wstring/print.bas +++ b/tests/wstring/print.bas @@ -126,7 +126,7 @@ SUITE( fbc_tests.wstring_.print_ ) OPEN_FILE( "print_strings.txt" ) check( "" ) - check( " " ) + '' check( " " ) '' can't test whitespace with INPUT check( "0123456789" ) check( "ABCDEFGHIJKLMNOP" ) check( !"\u3041\u3043\u3045\u3047\u3049" ) From 6f36ece1184ad4e670a546bab1df38463419dd75 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 13 Jul 2019 19:59:14 -0400 Subject: [PATCH 3/5] fbc-tests: tests/udt-zstring - appears to be some bad conversion from udt-wstring tests - remove wstring tests from tests/udt-zstring/swap.bas - modify wchar to char literals in tests/udt-zstring/str.bas --- tests/udt-zstring/str.bas | 8 ++++---- tests/udt-zstring/swap.bas | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/udt-zstring/str.bas b/tests/udt-zstring/str.bas index 4e1d4f419c..3733b2365a 100644 --- a/tests/udt-zstring/str.bas +++ b/tests/udt-zstring/str.bas @@ -78,12 +78,12 @@ SUITE( fbc_tests.udt_zstring_.str_ ) TEST( default ) - dim s1 as zstring * 10 = chr(1234) - dim s2 as zstring * 10 = chr(1234) + dim s1 as zstring * 10 = chr(12) + dim s2 as zstring * 10 = chr(12) dim s3 as zstring * 10 = str( s1 ) - dim u1 as ustring = chr(1234) - dim u2 as ustring = chr(1234) + dim u1 as ustring = chr(12) + dim u2 as ustring = chr(12) dim u3 as ustring = str( s1 ) dim u4 as ustring = wstr( u1 ) diff --git a/tests/udt-zstring/swap.bas b/tests/udt-zstring/swap.bas index 78f07853b1..5348cb8b3b 100644 --- a/tests/udt-zstring/swap.bas +++ b/tests/udt-zstring/swap.bas @@ -112,10 +112,6 @@ SUITE( fbc_tests.udt_zstring_.swap_ ) check( "a", "a" ) check( "a", "abcdefghi" ) - check( "", !"\u3041\u3043\u3045\u3047\u3049" ) - check( "abc", !"\u3041\u3043\u3045\u3047\u3049" ) - check( !"\u3045", !"\u3041\u3043\u3047\u3049" ) - END_TEST END_SUITE From 27c4cc9fb805e514046afe8c7479ebfecaef4290 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 13 Jul 2019 21:34:45 -0400 Subject: [PATCH 4/5] fbcunit: run_tests() returns false (failed) if any one assert fails --- tests/fbcunit/src/fbcunit.bas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/fbcunit/src/fbcunit.bas b/tests/fbcunit/src/fbcunit.bas index 2cf081536c..51b8954775 100644 --- a/tests/fbcunit/src/fbcunit.bas +++ b/tests/fbcunit/src/fbcunit.bas @@ -607,6 +607,10 @@ namespace fbcu fbcu_test_index = .test_index_next + if( .assert_pass_count <> .assert_count ) then + failed = true + end if + end with wend From a6e5e235d8ee69c47ea399bb36d951e050a3ec2d Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sat, 13 Jul 2019 21:35:56 -0400 Subject: [PATCH 5/5] fbcunit: update to version 0.8 --- tests/fbcunit/changelog.txt | 6 ++++++ tests/fbcunit/inc/fbcunit.bi | 4 ++-- tests/fbcunit/license.txt | 2 +- tests/fbcunit/readme.txt | 4 ++-- tests/fbcunit/src/fbcunit.bas | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/fbcunit/changelog.txt b/tests/fbcunit/changelog.txt index 68e0925ce6..a2081829ff 100644 --- a/tests/fbcunit/changelog.txt +++ b/tests/fbcunit/changelog.txt @@ -1,3 +1,9 @@ +Version 0.8 + +[changed] +- run_tests() returns false (failed) if any one assert fails + + Version 0.7 [added] diff --git a/tests/fbcunit/inc/fbcunit.bi b/tests/fbcunit/inc/fbcunit.bi index 04c3102e8f..a5d4b52d17 100644 --- a/tests/fbcunit/inc/fbcunit.bi +++ b/tests/fbcunit/inc/fbcunit.bi @@ -2,7 +2,7 @@ #define __FBCUNIT_BI_INCLUDE__ 1 '' fbcunit - FreeBASIC Compiler Unit Testing Component -'' Copyright (C) 2017-2018 Jeffery R. Marshall (coder[at]execulink[dot]com) +'' Copyright (C) 2017-2019 Jeffery R. Marshall (coder[at]execulink[dot]com) '' '' License: GNU Lesser General Public License '' version 2.1 (or any later version) plus @@ -13,7 +13,7 @@ ---------------------------------------------------------'/ #define FBCU_VER_MAJOR 0 -#define FBCU_VER_MINOR 7 +#define FBCU_VER_MINOR 8 #inclib "fbcunit" diff --git a/tests/fbcunit/license.txt b/tests/fbcunit/license.txt index 50ae59334c..fedf5edc86 100644 --- a/tests/fbcunit/license.txt +++ b/tests/fbcunit/license.txt @@ -1,5 +1,5 @@ fbcunit - FreeBASIC Compiler Unit Testing Component -Copyright (C) 2017-2018 Jeffery R. Marshall (coder[at]execulink[dot]com) +Copyright (C) 2017-2019 Jeffery R. Marshall (coder[at]execulink[dot]com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/tests/fbcunit/readme.txt b/tests/fbcunit/readme.txt index 6247499aad..cc3ee93e12 100644 --- a/tests/fbcunit/readme.txt +++ b/tests/fbcunit/readme.txt @@ -1,7 +1,7 @@ fbcunit - FreeBASIC Compiler Unit Testing Component - Copyright (C) 2017-2018 Jeffery R. Marshall (coder[at]execulink[dot]com) + Copyright (C) 2017-2019 Jeffery R. Marshall (coder[at]execulink[dot]com) -fbcunit version 0.7 +fbcunit version 0.8 ------------------- Unit testing component for fbc compiler. Provides macros and common code for unit testing fbc compiled sources. diff --git a/tests/fbcunit/src/fbcunit.bas b/tests/fbcunit/src/fbcunit.bas index 51b8954775..47c4e5ab23 100644 --- a/tests/fbcunit/src/fbcunit.bas +++ b/tests/fbcunit/src/fbcunit.bas @@ -1,5 +1,5 @@ '' fbcunit - FreeBASIC Compiler Unit Testing Component -'' Copyright (C) 2017-2018 Jeffery R. Marshall (coder[at]execulink[dot]com) +'' Copyright (C) 2017-2019 Jeffery R. Marshall (coder[at]execulink[dot]com) '' '' License: GNU Lesser General Public License '' version 2.1 (or any later version) plus