Check-in [035bcc0134]
Overview
Comment:Added more tests
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 035bcc01342b8d95cb31c723aa029b7b3b2cb8a5
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     59   	set v 1
    60     60   } err
    61     61   if {$err != "" || $v == 1} {
    62     62   	error "\[test4\] did not return the expected error"
    63     63   }
    64     64   
    65     65   # New API
           66  +## Simple test
    66     67   set handle [tcc4tcl::new]
    67     68   $handle cproc test5 {int i} int { return(i + 42); }
    68     69   if {[$handle code] == ""} {
    69     70   	error "[list $handle code] did not give code output"
    70     71   }
    71     72   $handle cproc test6 {int i} int { return(i + 42); }
    72     73   $handle go
    73     74   puts [test5 1]
    74     75   puts [test6 1]
    75     76   
           77  +## Delete without performing
           78  +set handle [tcc4tcl::new]
           79  +$handle delete
           80  +
           81  +# External functions (requires .a files)
    76     82   set handle [tcc4tcl::new]
    77     83   $handle ccode {const char *curl_version(void);}
    78     84   $handle cproc curl_version {} char*
    79     85   $handle add_library_path /usr/lib64
    80     86   $handle add_library_path /usr/lib
    81     87   $handle add_library curl
    82     88   $handle go
    83     89   puts [curl_version]
    84     90   
           91  +# wide values
    85     92   set handle [tcc4tcl::new]
    86         -$handle delete
           93  +$handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt {
           94  +	return(x);
           95  +}
           96  +$handle go
           97  +puts [wideTest 30]
           98  +