aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2006-12-26 20:01:37 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2006-12-26 20:01:37 +0000
commit51185d84093fca404992eb1eb2a46f464cae5794 (patch)
treedca2db1bf00cad5a0049cb9a59afd58c6311f2f3
parentfd8403344951097a3127d3e015d59023ff7aa783 (diff)
downloadpaludis-51185d84093fca404992eb1eb2a46f464cae5794.tar.gz
paludis-51185d84093fca404992eb1eb2a46f464cae5794.tar.xz
Tidy up doxygen comments. Fix bug in stringification when userland and kernel are equal and add a testcase for this.
-rw-r--r--paludis/host_tuple_name.cc4
-rw-r--r--paludis/host_tuple_name.hh30
-rw-r--r--paludis/host_tuple_name.sr4
-rw-r--r--paludis/host_tuple_name_TEST.cc25
4 files changed, 40 insertions, 23 deletions
diff --git a/paludis/host_tuple_name.cc b/paludis/host_tuple_name.cc
index 0a24b52..ed3de42 100644
--- a/paludis/host_tuple_name.cc
+++ b/paludis/host_tuple_name.cc
@@ -25,7 +25,7 @@
#include <ostream>
/** \file
- * Implementation of configuration_name.hh things.
+ * Implementation of host_tuple_name.hh things.
*
* \ingroup grpnames
*/
@@ -97,7 +97,7 @@ paludis::operator<< (std::ostream & s, const HostTupleName & c)
s << c.architecture;
if (! c.manufacturer.data().empty())
s << "-" << c.manufacturer;
- if (! c.kernel.data().empty())
+ if ((! c.kernel.data().empty()) && (c.kernel.data() != c.userland.data()))
s << "-" << c.kernel;
s << "-" << c.userland;
return s;
diff --git a/paludis/host_tuple_name.hh b/paludis/host_tuple_name.hh
index e9796ac..503a564 100644
--- a/paludis/host_tuple_name.hh
+++ b/paludis/host_tuple_name.hh
@@ -32,7 +32,7 @@
* Declarations for various Name classes.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
namespace paludis
@@ -42,7 +42,7 @@ namespace paludis
* an HostTupleName.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \ingroup grpexceptions
*/
class HostTupleNameError : public NameError
@@ -62,7 +62,7 @@ namespace paludis
* an ArchitectureNamePart.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \ingroup grpexceptions
*/
class ArchitectureNamePartError : public HostTupleNameError
@@ -79,7 +79,7 @@ namespace paludis
* of an ArchitectureNamePart.
*
* \ingroup grpnames
- * \ingroup configurationname
+ * \ingroup hosttuplename
*/
struct ArchitectureNamePartValidator :
private InstantiationPolicy<ArchitectureNamePartValidator, instantiation_method::NonInstantiableTag>
@@ -96,7 +96,7 @@ namespace paludis
* architecture part of a HostTupleName.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
typedef Validated<std::string, ArchitectureNamePartValidator> ArchitectureNamePart;
@@ -105,7 +105,7 @@ namespace paludis
* an ManufacturerNamePart.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \ingroup grpexceptions
*/
class ManufacturerNamePartError : public HostTupleNameError
@@ -122,7 +122,7 @@ namespace paludis
* of an ManufacturerNamePart.
*
* \ingroup grpnames
- * \ingroup configurationname
+ * \ingroup hosttuplename
*/
struct ManufacturerNamePartValidator :
private InstantiationPolicy<ManufacturerNamePartValidator, instantiation_method::NonInstantiableTag>
@@ -139,7 +139,7 @@ namespace paludis
* architecture part of a HostTupleName.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
typedef Validated<std::string, ManufacturerNamePartValidator> ManufacturerNamePart;
@@ -148,7 +148,7 @@ namespace paludis
* an KernelNamePart.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \ingroup grpexceptions
*/
class KernelNamePartError : public HostTupleNameError
@@ -165,7 +165,7 @@ namespace paludis
* of an KernelNamePart.
*
* \ingroup grpnames
- * \ingroup configurationname
+ * \ingroup hosttuplename
*/
struct KernelNamePartValidator :
private InstantiationPolicy<KernelNamePartValidator, instantiation_method::NonInstantiableTag>
@@ -182,7 +182,7 @@ namespace paludis
* architecture part of a HostTupleName.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
typedef Validated<std::string, KernelNamePartValidator> KernelNamePart;
@@ -191,7 +191,7 @@ namespace paludis
* an UserlandNamePart.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \ingroup grpexceptions
*/
class UserlandNamePartError : public HostTupleNameError
@@ -208,7 +208,7 @@ namespace paludis
* of an UserlandNamePart.
*
* \ingroup grpnames
- * \ingroup configurationname
+ * \ingroup hosttuplename
*/
struct UserlandNamePartValidator :
private InstantiationPolicy<UserlandNamePartValidator, instantiation_method::NonInstantiableTag>
@@ -225,7 +225,7 @@ namespace paludis
* architecture part of a HostTupleName.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
typedef Validated<std::string, UserlandNamePartValidator> UserlandNamePart;
@@ -236,7 +236,7 @@ namespace paludis
* Output a QualifiedPackageName to a stream.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
*/
std::ostream & operator<< (std::ostream &, const HostTupleName &);
}
diff --git a/paludis/host_tuple_name.sr b/paludis/host_tuple_name.sr
index 37dcb8e..9c15705 100644
--- a/paludis/host_tuple_name.sr
+++ b/paludis/host_tuple_name.sr
@@ -16,10 +16,10 @@ END
doxygen_comment << "END"
/**
- * Represents a configuration name as expected by autotools.
+ * Represents a host tuple name as expected by autotools.
*
* \ingroup grpnames
- * \ingroup grpconfigurationname
+ * \ingroup grphosttuplename
* \nosubgrouping
*/
END
diff --git a/paludis/host_tuple_name_TEST.cc b/paludis/host_tuple_name_TEST.cc
index ff5e0d0..c7f701f 100644
--- a/paludis/host_tuple_name_TEST.cc
+++ b/paludis/host_tuple_name_TEST.cc
@@ -21,7 +21,7 @@
#include <paludis/util/exception.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-
+#include <iostream>
using namespace test;
using namespace paludis;
@@ -45,7 +45,7 @@ namespace test_cases
HostTupleName a("i686-unknown-linux-gnu");
TEST_CHECK(true);
}
- } test_configuration_name;
+ } test_host_tuple_name;
/**
* \test Validate HostTupleName tests.
@@ -62,7 +62,7 @@ namespace test_cases
TEST_CHECK_THROWS(a = HostTupleName("foo-bar!"), HostTupleNameError);
TEST_CHECK_THROWS(a = HostTupleName("foo-bar-baz-too-many"), HostTupleNameError);
}
- } test_configuration_name_validate;
+ } test_host_tuple_name_validate;
/**
* \test Compare HostTupleName tests.
@@ -85,7 +85,24 @@ namespace test_cases
TEST_CHECK( (foo1 == foo4));
}
- } test_configuration_name_compare;
+ } test_host_tuple_name_compare;
+
+ /**
+ * \test HostTupleName stringification tests.
+ *
+ */
+ struct HostTupleNameStringificationTest : TestCase
+ {
+ HostTupleNameStringificationTest() : TestCase("stringification") { }
+
+ void run()
+ {
+ HostTupleName htn("i686-gentoo-freebsd6.2");
+
+ std::cout << "FOO: " << stringify(htn) << std::endl;
+ TEST_CHECK( ("i686-gentoo-freebsd6.2" == stringify(htn)) );
+ }
+ } test_host_tuple_name_stringification;
/**
* \test Test ArchitectureNamePart creation.