 ! Copyright (C) 2009 Jeremy Hughes.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.inline alien.marshall.syntax destructors
-tools.test ;
+tools.test accessors kernel ;
 IN: alien.marshall.syntax.tests
 
 DELETE-C-LIBRARY: test


{ 2 2 } [ outarg2 ] must-infer-as
[ 18 15 ] [ 3 5 outarg2 ] unit-test

    return x;
;

CM-STRUCTURE: wedge
    { "double" "degrees" } ;

CM-STRUCTURE: sundial
    { "double" "radius" }
    { "wedge" "wedge" } ;

CM-FUNCTION: double hours ( sundial* d )
    return d->wedge.degrees / 30;
;

CM-FUNCTION: void change_time ( double hours, sundial* d )
    d->wedge.degrees = hours * 30;
;

;C-LIBRARY

{ 1 1 } [ outarg1 ] must-infer-as
