40 lines
929 B
C++
40 lines
929 B
C++
/**
|
|
* @file
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/tags/generic.h>
|
|
#include <tests/test.h>
|
|
|
|
static void test_generic_tag()
|
|
{
|
|
GenericTag tag("Generic Tag");
|
|
File f("generic_tag", 0);
|
|
|
|
test_equal(tag.name(), (std::string)"Generic Tag");
|
|
test_equal(tag.lowercase(), (std::string)"generic tag");
|
|
test_equal(tag.primary_key(), (std::string)"Generic Tag");
|
|
|
|
f.open(OPEN_WRITE);
|
|
tag.write(f);
|
|
f.close();
|
|
|
|
tag = GenericTag();
|
|
test_equal(tag.name(), (std::string)"");
|
|
test_equal(tag.lowercase(), (std::string)"");
|
|
test_equal(tag.primary_key(), (std::string)"");
|
|
|
|
f.open(OPEN_READ);
|
|
tag.read(f);
|
|
f.close();
|
|
|
|
test_equal(tag.name(), (std::string)"Generic Tag");
|
|
test_equal(tag.lowercase(), (std::string)"generic tag");
|
|
test_equal(tag.primary_key(), (std::string)"Generic Tag");
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
run_test("Generic Tag Test", test_generic_tag);
|
|
return 0;
|
|
}
|