Overview
Comment: | Added more tests |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
035bcc01342b8d95cb31c723aa029b7b |
User & Date: | rkeene on 2014-06-23 01:40:05 |
Other Links: | manifest | tags |
Context
2014-06-23
| ||
01:45 | Updated to correctly define C functions that take no arguments (void) check-in: 9dea15950f user: rkeene tags: trunk | |
01:40 | Added more tests check-in: 035bcc0134 user: rkeene tags: trunk | |
01:39 | Corrected issue where path to headers and libraries was reset when adding libraries and header paths check-in: 79472adb57 user: rkeene tags: trunk | |
Changes
Modified test.tcl from [cd217a385a] to [533a781ff7].
︙ | ︙ | |||
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | set v 1 } err if {$err != "" || $v == 1} { error "\[test4\] did not return the expected error" } # New API set handle [tcc4tcl::new] $handle cproc test5 {int i} int { return(i + 42); } if {[$handle code] == ""} { error "[list $handle code] did not give code output" } $handle cproc test6 {int i} int { return(i + 42); } $handle go puts [test5 1] puts [test6 1] set handle [tcc4tcl::new] $handle ccode {const char *curl_version(void);} $handle cproc curl_version {} char* $handle add_library_path /usr/lib64 $handle add_library_path /usr/lib $handle add_library curl $handle go puts [curl_version] set handle [tcc4tcl::new] | > > > > > > > > > > | > > | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | set v 1 } err if {$err != "" || $v == 1} { error "\[test4\] did not return the expected error" } # New API ## Simple test set handle [tcc4tcl::new] $handle cproc test5 {int i} int { return(i + 42); } if {[$handle code] == ""} { error "[list $handle code] did not give code output" } $handle cproc test6 {int i} int { return(i + 42); } $handle go puts [test5 1] puts [test6 1] ## Delete without performing set handle [tcc4tcl::new] $handle delete # External functions (requires .a files) set handle [tcc4tcl::new] $handle ccode {const char *curl_version(void);} $handle cproc curl_version {} char* $handle add_library_path /usr/lib64 $handle add_library_path /usr/lib $handle add_library curl $handle go puts [curl_version] # wide values set handle [tcc4tcl::new] $handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt { return(x); } $handle go puts [wideTest 30] |