Example #1
0
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);
	}
}
Example #2
0
BackendModel::BackendModel(QObject *parent) :
    ObjectModel(ObjectInfo<Backend>::classUuidProperty(), parent)
{
  setTextProperty( "title" );
  connect( this, &BackendModel::databaseChanged, this, &BackendModel::refresh );
}
Example #3
0
/// @todo restrict to setting valid nucleotides
void  setNucleotidesProperty(NucleotidesProperty *pro, const char *nucleotides) {
	if (pro)
		setTextProperty(pro->nucleotides, nucleotides);
}
Example #4
0
void setURIProperty(URIProperty* pro, const char* uri) {
	if (pro && pro->doc && uri && !isSBOLObjectURI(pro->doc, uri))
		setTextProperty(pro->uri, uri);
}
Example #5
0
void setSBOLCompoundObjectDescription(SBOLCompoundObject* obj, const char* descr) {
	if (obj) {
		setTextProperty(obj->description, descr);
	}
}
Example #6
0
void setSBOLCompoundObjectName(SBOLCompoundObject* obj, const char* name) {
	if (obj) {
		setTextProperty(obj->name, name);
	}
}
Example #7
0
void setSBOLCompoundObjectDisplayID(SBOLCompoundObject* obj, const char* id) {
	if (obj) {
		setTextProperty(obj->displayID, id);
	}
}