mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-15 03:01:47 -07:00
Started sanity test suite (Non-parsed api)
Made some fixes based on errors found while iterating on first generation
This commit is contained in:
@ -307,12 +307,12 @@ struct GenArrayRequest
|
||||
};
|
||||
Array(GenArrayRequest) GenArrayRequests;
|
||||
|
||||
void gen__array_request( StrC type, StrC dep, sw size )
|
||||
void gen__array_request( StrC type, sw size, StrC dep = {} )
|
||||
{
|
||||
GenArrayRequest request = { type, dep, size };
|
||||
array_append( GenArrayRequests, request );
|
||||
}
|
||||
#define Gen_Array( type ) gen__array_request( txt_n_len( type ), sizeof(type) )
|
||||
#define Gen_Array( type ) gen__array_request( { txt_n_len(type) }, sizeof(type) )
|
||||
|
||||
u32 gen_array_file()
|
||||
{
|
||||
|
47
test/NonParsed/Sanity.hpp
Normal file
47
test/NonParsed/Sanity.hpp
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
|
||||
#ifdef gen_time
|
||||
#include "gen.hpp"
|
||||
|
||||
using namespace gen;
|
||||
|
||||
u32 gen_sanity()
|
||||
{
|
||||
Builder
|
||||
gen_sanity_file;
|
||||
gen_sanity_file.open("./sanity.gen.hpp");
|
||||
|
||||
// Comment
|
||||
{
|
||||
Code comment_test = def_comment( StrC::from("Sanity check: def_omment test") );
|
||||
|
||||
gen_sanity_file.print(comment_test);
|
||||
gen_sanity_file.print_fmt("\n");
|
||||
}
|
||||
|
||||
// Class
|
||||
{
|
||||
Code fwd = def_class( StrC::from("Test_EmptyClass") );
|
||||
Code empty_body;
|
||||
{
|
||||
Code cmt = def_comment( StrC::from("Empty class") );
|
||||
Code body = def_class_body( 1, cmt );
|
||||
|
||||
empty_body = def_class( StrC::from("Test_EmptyClass"), body );
|
||||
}
|
||||
|
||||
gen_sanity_file.print(fwd);
|
||||
gen_sanity_file.print(empty_body);
|
||||
}
|
||||
|
||||
gen_sanity_file.print_fmt("\n");
|
||||
|
||||
//
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
gen_sanity_file.write();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user