From a5f9ef118a6e162cfe2133fc90a10e57c3c9535b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 9 Sep 2020 12:38:02 +0200 Subject: [PATCH] feature complete test --- src/base64.f90 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/base64.f90 b/src/base64.f90 index fac08f80e..eb2a1e929 100644 --- a/src/base64.f90 +++ b/src/base64.f90 @@ -178,7 +178,7 @@ subroutine selfTest bytes = base64_to_bytes(zero_to_three) if(any(bytes /= int([0,1,2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 4) call IO_error(0,ext_msg='base64_to_bytes//') - + bytes = base64_to_bytes(zero_to_three,e=1_pLongInt) if(any(bytes /= int([0],C_SIGNED_CHAR)) .or. size(bytes) /= 1) call IO_error(0,ext_msg='base64_to_bytes//1') bytes = base64_to_bytes(zero_to_three,e=2_pLongInt) @@ -187,7 +187,7 @@ subroutine selfTest if(any(bytes /= int([0,1,2],C_SIGNED_CHAR)) .or. size(bytes) /= 3) call IO_error(0,ext_msg='base64_to_bytes//3') bytes = base64_to_bytes(zero_to_three,e=4_pLongInt) if(any(bytes /= int([0,1,2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 4) call IO_error(0,ext_msg='base64_to_bytes//4') - + bytes = base64_to_bytes(zero_to_three,s=1_pLongInt) if(any(bytes /= int([0,1,2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 4) call IO_error(0,ext_msg='base64_to_bytes/1/') bytes = base64_to_bytes(zero_to_three,s=2_pLongInt) @@ -196,7 +196,7 @@ subroutine selfTest if(any(bytes /= int([2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 2) call IO_error(0,ext_msg='base64_to_bytes/3/') bytes = base64_to_bytes(zero_to_three,s=4_pLongInt) if(any(bytes /= int([3],C_SIGNED_CHAR)) .or. size(bytes) /= 1) call IO_error(0,ext_msg='base64_to_bytes/4/') - + bytes = base64_to_bytes(zero_to_three,s=1_pLongInt,e=1_pLongInt) if(any(bytes /= int([0],C_SIGNED_CHAR)) .or. size(bytes) /= 1) call IO_error(0,ext_msg='base64_to_bytes/1/1') bytes = base64_to_bytes(zero_to_three,s=2_pLongInt,e=2_pLongInt) @@ -205,7 +205,21 @@ subroutine selfTest if(any(bytes /= int([2],C_SIGNED_CHAR)) .or. size(bytes) /= 1) call IO_error(0,ext_msg='base64_to_bytes/3/3') bytes = base64_to_bytes(zero_to_three,s=4_pLongInt,e=4_pLongInt) if(any(bytes /= int([3],C_SIGNED_CHAR)) .or. size(bytes) /= 1) call IO_error(0,ext_msg='base64_to_bytes/4/4') - + + bytes = base64_to_bytes(zero_to_three,s=1_pLongInt,e=2_pLongInt) + if(any(bytes /= int([0,1],C_SIGNED_CHAR)) .or. size(bytes) /= 2) call IO_error(0,ext_msg='base64_to_bytes/1/2') + bytes = base64_to_bytes(zero_to_three,s=2_pLongInt,e=3_pLongInt) + if(any(bytes /= int([1,2],C_SIGNED_CHAR)) .or. size(bytes) /= 2) call IO_error(0,ext_msg='base64_to_bytes/2/3') + bytes = base64_to_bytes(zero_to_three,s=3_pLongInt,e=4_pLongInt) + if(any(bytes /= int([2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 2) call IO_error(0,ext_msg='base64_to_bytes/3/4') + + bytes = base64_to_bytes(zero_to_three,s=1_pLongInt,e=3_pLongInt) + if(any(bytes /= int([0,1,2],C_SIGNED_CHAR)) .or. size(bytes) /= 3) call IO_error(0,ext_msg='base64_to_bytes/1/3') + bytes = base64_to_bytes(zero_to_three,s=2_pLongInt,e=4_pLongInt) + if(any(bytes /= int([1,2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 3) call IO_error(0,ext_msg='base64_to_bytes/2/4') + + bytes = base64_to_bytes(zero_to_three,s=1_pLongInt,e=4_pLongInt) + if(any(bytes /= int([0,1,2,3],C_SIGNED_CHAR)) .or. size(bytes) /= 4) call IO_error(0,ext_msg='base64_to_bytes/1/4') end subroutine selfTest