Converted .function file to c-like format and adapted generator code
diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function
index b4f7835..680dfb4 100644
--- a/tests/suites/test_suite_x509write.function
+++ b/tests/suites/test_suite_x509write.function
@@ -1,16 +1,18 @@
-BEGIN_HEADER
+/* BEGIN_HEADER */
#include <polarssl/x509write.h>
#include <polarssl/x509.h>
#include <polarssl/pem.h>
#include <polarssl/oid.h>
-END_HEADER
+/* END_HEADER */
-BEGIN_DEPENDENCIES
-depends_on:POLARSSL_X509_WRITE_C:POLARSSL_BIGNUM_C
-END_DEPENDENCIES
+/* BEGIN_DEPENDENCIES
+ * depends_on:POLARSSL_X509_WRITE_C:POLARSSL_BIGNUM_C
+ * END_DEPENDENCIES
+ */
-BEGIN_CASE
-x509_cert_req_check:key_file:#md_type:cert_req_check_file
+/* BEGIN_CASE */
+void x509_cert_req_check( char *key_file, int md_type,
+ char *cert_req_check_file )
{
rsa_context rsa;
pem_context pem;
@@ -41,17 +43,17 @@
strcpy( cur->name, "NL" );
memset( &rsa, 0, sizeof(rsa_context) );
- ret = x509parse_keyfile_rsa( &rsa, {key_file}, NULL );
+ ret = x509parse_keyfile_rsa( &rsa, key_file, NULL );
TEST_ASSERT( ret == 0 );
if( ret != 0 )
- return 0;
+ return;
- ret = x509_write_cert_req( buf, 4000, &rsa, &req_name, {md_type} );
+ ret = x509_write_cert_req( buf, 4000, &rsa, &req_name, md_type );
TEST_ASSERT( ret >= 0 );
c = buf + 3999 - ret;
- f = fopen( {cert_req_check_file}, "r" );
+ f = fopen( cert_req_check_file, "r" );
TEST_ASSERT( f != NULL );
fread( check_buf, 1, 4000, f );
fclose( f );
@@ -71,4 +73,4 @@
rsa_free( &rsa );
pem_free( &pem );
}
-END_CASE
+/* END_CASE */