17 #define pt_assert(cond) arb_assert(cond)
33 SOME_OF_EXTENDED_DATA,
36 SOME_OF_ALI_CONTAINER,
39 Need data_needed(
GBDATA *gbd,
const char *keyname, Need from)
const {
43 if (strcmp(keyname,
"genom_db") == 0)
return ALL;
44 if (strcmp(keyname,
"gene_map") == 0)
return ALL;
45 if (strcmp(keyname,
"species_data") == 0)
return SOME_OF_SPECIES_DATA;
46 if (strcmp(keyname,
"extended_data") == 0)
return SOME_OF_EXTENDED_DATA;
47 if (strcmp(keyname,
"presets") == 0)
return ALL;
50 case SOME_OF_SPECIES_DATA:
51 if (strcmp(keyname,
"species") == 0) {
53 return SOME_OF_SPECIES;
57 case SOME_OF_EXTENDED_DATA:
58 if (strcmp(keyname,
"extended") == 0) {
60 if (strcmp(sainame,
"ECOLI") == 0)
return SOME_OF_EXTENDED;
61 if (strcmp(sainame,
"HELIX") == 0)
return SOME_OF_EXTENDED;
62 if (strcmp(sainame,
"HELIX_NR") == 0)
return SOME_OF_EXTENDED;
67 if (strcmp(keyname,
"abspos") == 0)
return ALL;
68 if (strcmp(keyname,
"start") == 0)
return ALL;
69 if (strcmp(keyname,
"stop") == 0)
return ALL;
72 case SOME_OF_EXTENDED:
73 if (strcmp(keyname,
"name") == 0)
return ALL;
74 if (strcmp(keyname,
"acc") == 0)
return ALL;
75 if (strcmp(keyname,
"full_name") == 0)
return ALL;
76 if (strcmp(keyname, ali_name) == 0)
return SOME_OF_ALI_CONTAINER;
79 case SOME_OF_ALI_CONTAINER:
80 if (strcmp(keyname,
"data") == 0)
return ALL;
90 GB_ERROR del_child(
GBDATA *gb_entry,
const char *keyname, Need from) {
92 Need need = data_needed(gb_entry, keyname, from);
94 case NONE: error =
GB_delete(gb_entry);
break;
96 default: error = del_subentries(gb_entry, need);
break;
104 for (
GBDATA *gb_child =
GB_child(gb_father); gb_child && !
error; gb_child = gb_next_child) {
107 error = del_child(gb_child, key, from);
128 else error = del_subentries(gb_main, SOME_OF_ROOT);
153 void TEST_SLOW_ptclean() {
156 const char *saveas =
"TEST_pt_cleaned.arb";
164 #if defined(TEST_AUTO_UPDATE)
165 TEST_COPY_FILE(
"TEST_pt_cleaned.arb",
"TEST_pt_cleaned_expected.arb");
GBDATA * GB_open(const char *path, const char *opent)
GBDATA * GB_child(GBDATA *father)
bool GB_is_temporary(GBDATA *gbd)
GB_ERROR del_unwanted_entries()
int GB_unlink(const char *path)
GB_ERROR GB_delete(GBDATA *&source)
#define TEST_PUBLISH(testfunction)
GB_ERROR GB_await_error()
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
GB_ERROR GB_save_as(GBDATA *gbd, const char *path, const char *savetype)
#define TEST_REJECT_NULL(n)
static void error(const char *msg)
#define TEST_EXPECT_ZERO_OR_SHOW_ERRNO(iocond)
EntryRemover(GBDATA *gb_main_)
GB_ERROR cleanup_ptserver_database(GBDATA *gb_main)
GB_ERROR clean_ptserver_database(GBDATA *gb_main)
#define TEST_EXPECT_NO_ERROR(call)
char * GBT_get_default_alignment(GBDATA *gb_main)
GB_ERROR GB_request_undo_type(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT_TODO
GBDATA * GB_nextChild(GBDATA *child)
long GBT_get_species_count(GBDATA *gb_main)
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
#define TEST_EXPECT_TEXTFILES_EQUAL(fgot, fwant)
void GB_close(GBDATA *gbd)