Example #1
0
void file_t()
{
	int fd = open("/tmp/file_test_a", O_WRONLY | O_CREAT);
	char a[] = "data";
	write(fd, a, sizeof(a));
	close(fd);

	//
	char *source, *dest;
	source = "this is string";
	dest = (char *)malloc(sizeof(char)*6);
	copy_string(source, dest, 5);
	printf("\n<-------------copy string function----------------->\n");
	printf("source string is : %s, \ndest string copied is : %s", source, dest);

	// 
	char buffer[10];
	fd = open("/tmp/file_test_a", O_RDONLY);
	read(fd, buffer, 3);
	close(fd);
	printf("\n%s\n", buffer);

	//
	test_const();

	test_enum();

	test_snprintf();

	test_if_likely();

	test_define();
}
Example #2
0
int main(int argc , char ** argv) {
  const char * config_file = argv[1];
  config_type * config = config_create_schema();
  
  test_define( config , config_file );

  config_free( config );
  exit(0);
}
Example #3
0
int main(int argc , char ** argv) {
  util_install_signals();
  {
    const char * config_file = argv[1];
    config_parser_type * config = config_create_schema();
    
    test_define( config , config_file );
    
    config_free( config );
    exit(0);
  }
}