Add more tests
authorLi Qun <qun.li@uestcmail.com>
Wed Mar 18 21:24:34 2009 +0800 (16 months ago)
changeset 100669c97cdac32
parent 9984d7ea0a13f1
child 101957e8b0902fb
Add more tests
codegen/genrpc/converter.scm
codegen/test-genrpc.scm
       1 --- a/codegen/genrpc/converter.scm	Wed Mar 18 21:19:16 2009 +0800
       2 +++ b/codegen/genrpc/converter.scm	Wed Mar 18 21:24:34 2009 +0800
       3 @@ -171,8 +171,7 @@
       4      (indent 2)
       5      (format #t "caprpc_value *~a = NULL;\n\n" field-name)
       6      (indent 2)
       7 -    ;; FIXME: need to check the type of its element and find proper marshal function
       8 -    (format #t "~a = marshal_~a(&~a, ~a->~a + ~a);\t// FIXME\n"
       9 +    (format #t "~a = marshal_~a(&~a, ~a->~a + ~a);\n"
      10  	    %return-value-name field-type field-name %struct-value-name field-name temp-index-name)
      11      (indent 2)
      12      (format #t "if (~a != ~a) {\n" %return-value-name %success-return-value)
      13 @@ -223,8 +222,7 @@
      14      (format #t "for (~a = 0; ~a < ~a; ++~a) {\n"
      15  	    temp-index-name temp-index-name temp-length-name temp-index-name)
      16      (indent 2)
      17 -    ;; FIXME: find proper unmarshal function here
      18 -    (format #t "unmarshal_~a(caprpc_value_get_item(~a), ~a + ~a);// FIXME\n"
      19 +    (format #t "unmarshal_~a(caprpc_value_get_item(~a), ~a + ~a);\n"
      20  	    field-type temp-index-name field-name temp-index-name)
      21      (indent 1)
      22      (format #t "}\n\n")
     1.1 --- a/codegen/test-genrpc.scm	Wed Mar 18 21:19:16 2009 +0800
     1.2 +++ b/codegen/test-genrpc.scm	Wed Mar 18 21:24:34 2009 +0800
     1.3 @@ -13,9 +13,11 @@
     1.4  ;;   params: struct-name ((type field-name) ...)
     1.5  (converter:def-c-struct 'cat  '((int height) (int weight)))
     1.6  (converter:def-c-struct 'specialcat '((string name) (cat catptr)))
     1.7 +(converter:def-c-struct 'catpair '((cat pcat1) (specialcat pcat2)))
     1.8  
     1.9  (converter:def-c-array 'users '(string username) 'count)
    1.10  (converter:def-c-array 'cats '(cat catptr) 'count)
    1.11 +(converter:def-c-array 'specialcats '(specialcat catptr) 'number)
    1.12  
    1.13  (utils:write-base-marshal!)
    1.14  (utils:write-base-unmarshal!)