Review all tests

This commit is contained in:
Federico Aponte
2025-02-03 14:38:51 +01:00
parent aba386a11c
commit 5a47094e35
15 changed files with 2536 additions and 1212 deletions

50
test/test_gosub.cpp Normal file
View File

@@ -0,0 +1,50 @@
//
#include <csetjmp>
#include <iostream>
#define VB6_GOSUB(sub) if(!setjmp(_gs)){goto sub;}
#define VB6_RETURN longjmp(_gs,1)
using namespace std;
/*
Sub foo()
GoSub mysub1
Exit Sub
mysub1:
Debug.Print "mysub1"
Return
mysub2:
Debug.Print "mysub2"
Return
End Sub
#define GOSUB(sub) if(!setjmp(_gs)){goto sub;}
#define RETURN longjmp(_gs,1)
*/
void test_gosub(ostream& os)
{
os << "---- begin " << __func__ << " ----\n";
jmp_buf _gs;
VB6_GOSUB(sub1);
os << " after calling subroutine 1\n";
VB6_GOSUB(sub2);
os << " after calling subroutine 2\n";
return;
sub1:
os << " in subroutine 1\n";
VB6_RETURN;
sub2:
os << " in subroutine 2\n";
VB6_RETURN;
}