void TestGetSetCompareProperty(CuTest* tc) { TextProperty* pro; char* data; int repeat; // test null pro = createTextProperty(); setTextProperty(pro, NULL); CuAssertPtrEquals(tc, NULL, getTextProperty(pro)); // test empty pro = createTextProperty(); setTextProperty(pro, ""); CuAssertStrEquals(tc, "", getTextProperty(pro)); // test lots of random variations for (repeat=0; repeat<NUM_FAST_TESTS; repeat++) { data = randomString(); pro = createTextProperty(); setTextProperty(pro, data); CuAssertStrEquals(tc, data, getTextProperty(pro)); CuAssertIntEquals(tc, 0, strcmp(getTextProperty(pro), data)); deleteTextProperty(pro); } }
BackendModel::BackendModel(QObject *parent) : ObjectModel(ObjectInfo<Backend>::classUuidProperty(), parent) { setTextProperty( "title" ); connect( this, &BackendModel::databaseChanged, this, &BackendModel::refresh ); }
/// @todo restrict to setting valid nucleotides void setNucleotidesProperty(NucleotidesProperty *pro, const char *nucleotides) { if (pro) setTextProperty(pro->nucleotides, nucleotides); }
void setURIProperty(URIProperty* pro, const char* uri) { if (pro && pro->doc && uri && !isSBOLObjectURI(pro->doc, uri)) setTextProperty(pro->uri, uri); }
void setSBOLCompoundObjectDescription(SBOLCompoundObject* obj, const char* descr) { if (obj) { setTextProperty(obj->description, descr); } }
void setSBOLCompoundObjectName(SBOLCompoundObject* obj, const char* name) { if (obj) { setTextProperty(obj->name, name); } }
void setSBOLCompoundObjectDisplayID(SBOLCompoundObject* obj, const char* id) { if (obj) { setTextProperty(obj->displayID, id); } }