Skip to content

Commit

Permalink
Add private test for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed May 13, 2015
1 parent 2596d0a commit 146d988
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dcmtkpp/Tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ ::Tag(char const * string)
this->_from_string(string);
}

bool
Tag
::is_private() const
{
return (this->group%2 == 1);
}

std::string
Tag
::get_name() const
Expand Down
2 changes: 2 additions & 0 deletions src/dcmtkpp/Tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class Tag
/// @brief Element of the tag.
uint16_t element;

bool is_private() const;

/**
* @brief Return the name of the tag.
*
Expand Down
9 changes: 9 additions & 0 deletions tests/code/Tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ BOOST_AUTO_TEST_CASE(CopyConstructor)
BOOST_CHECK_EQUAL(other.element, 0xbeef);
}

BOOST_AUTO_TEST_CASE(IsPrivate)
{
dcmtkpp::Tag const tag1(0xdead, 0xbeef);
dcmtkpp::Tag const tag2(0x7fe0, 0x0010);

BOOST_CHECK(tag1.is_private());
BOOST_CHECK(!tag2.is_private());
}

BOOST_AUTO_TEST_CASE(Name)
{
dcmtkpp::Tag const tag(0x7fe0, 0x0010);
Expand Down

0 comments on commit 146d988

Please sign in to comment.