Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
    printf("** dablooms version: %s\n", dablooms_version());
    int i;
    int failures = 0, warnings = 0;
    
    if (argc != 3) {
        fprintf(stderr, "Usage: %s <bloom_file> <words_file>\n", argv[0]);
        return EXIT_FAILURE;
    }
    
    int (*tests[])(const char *, const char *) = {
        test_counting_remove_reopen,
        test_counting_accuracy,
        test_scaling_remove_reopen,
        test_scaling_accuracy,
        NULL,
    };
    for (i = 0; tests[i] != NULL;  i++) {
        int result = (tests[i])(argv[1], argv[2]);
        if (result == TEST_FAIL) {
            failures++;
        } else if (result == TEST_WARN) {
            warnings++;
        }
    }
    
    printf("\n** %d failures, %d warnings\n", failures, warnings);
    if (failures) {
        return EXIT_FAILURE;
    } else {
        return EXIT_SUCCESS;
    }
}
Ejemplo n.º 2
0
static VALUE db_check(VALUE self, VALUE hash)
{
  //DabloomStruct* ds;
  //const char *chash = RSTRING(hash);

  //Data_Get_Struct(self, DabloomStruct, ds);
  //return scaling_bloom_check(ds->filter, chash);
	return dablooms_version();
}