Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #if 0
00020 #include <ept/tests/test-utils.h>
00021 #include <ept/debtags/tag.h>
00022 #include <ept/debtags/vocabulary.h>
00023 #include <ept/debtags/maint/path.h>
00024
00025 #include <tagcoll/utils/set.h>
00026
00027 using namespace std;
00028 using namespace ept::debtags;
00029
00030 namespace tut {
00031
00032 struct ept_debtags_tag_shar
00033 {
00034 Path::OverrideDebtagsSourceDir odsd;
00035 Path::OverrideDebtagsIndexDir odid;
00036 Path::OverrideDebtagsUserSourceDir odusd;
00037 Path::OverrideDebtagsUserIndexDir oduid;
00038 Vocabulary voc;
00039
00040 ept_debtags_tag_shar()
00041 : odsd("./"), odid("./"), odusd("./"), oduid("./") {}
00042 };
00043
00044 TESTGRP( ept_debtags_tag );
00045
00046 template<> template<>
00047 void to::test<1>()
00048 {
00049 Tag a, b;
00050 ensure( a == b );
00051 ensure( !a.valid() );
00052 ensure( !b.valid() );
00053 }
00054
00055 template<> template<>
00056 void to::test<2>()
00057 {
00058 Tag a;
00059 int x = 1;
00060 try {
00061 a.shortDescription();
00062 x = 2;
00063 } catch (...) {
00064 x = 3;
00065 }
00066 ensure_equals( x, 3 );
00067 }
00068
00069 template<> template<>
00070 void to::test< 3 >()
00071 {
00072 Facet f = voc.facetByName( "works-with" );
00073 Tag t = voc.tagByName( "works-with::people" );
00074 ensure( t.valid() );
00075 ensure( f.valid() );
00076 ensure( t.facet() == f );
00077 ensure( tagcoll::utils::set_contains(f.tags(), t) );
00078 }
00079
00080 template<> template<>
00081 void to::test< 4 >()
00082 {
00083 Facet f = voc.facetByName( "works-with" );
00084 Tag t = voc.tagByName( "works-with::people" );
00085 ensure( t.valid() );
00086 ensure( f.valid() );
00087 ensure( f.hasTag( t.name() ) );
00088 }
00089
00090 template<> template<>
00091 void to::test< 5 >()
00092 {
00093 Tag t = voc.tagByName( "works-with::people" );
00094 ensure( t.valid() );
00095 ensure( t.facet().hasTag( t.name() ) );
00096 ensure( tagcoll::utils::set_contains(t.facet().tags(), t) );
00097 }
00098
00099 }
00100
00101
00102
00103
00104
00105
00106
00107 #endif