Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
75af3d19
Commit
75af3d19
authored
Feb 18, 2014
by
Steven Murray
Browse files
Ported ParamTest.cpp from CPPUNIT to gtest.
parent
7ee89114
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/log/ParamTest.cpp
0 → 100644
View file @
75af3d19
/******************************************************************************
* test/unittest/castor/log/ParamTest.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Steven.Murray@cern.ch
*****************************************************************************/
#include
"castor/log/Param.hpp"
#include
<gtest/gtest.h>
#include
<memory>
namespace
unitTests
{
class
castor_log_ParamTest
:
public
::
testing
::
Test
{
protected:
void
SetUp
()
{
}
void
TearDown
()
{
}
};
// castor_log_ParamTest
TEST_F
(
castor_log_ParamTest
,
testConstructorWithAString
)
{
using
namespace
castor
::
log
;
std
::
auto_ptr
<
Param
>
param
;
ASSERT_NO_THROW
(
param
.
reset
(
new
Param
(
"Name"
,
"Value"
)));
ASSERT_EQ
(
std
::
string
(
"Name"
),
param
->
getName
());
ASSERT_EQ
(
std
::
string
(
"Value"
),
param
->
getValue
());
}
TEST_F
(
castor_log_ParamTest
,
testConstructorWithAnInt
)
{
using
namespace
castor
::
log
;
std
::
auto_ptr
<
Param
>
param
;
ASSERT_NO_THROW
(
param
.
reset
(
new
Param
(
"Name"
,
1234
)));
ASSERT_EQ
(
std
::
string
(
"Name"
),
param
->
getName
());
ASSERT_EQ
(
std
::
string
(
"1234"
),
param
->
getValue
());
}
}
// namespace unitTests
test/CMakeLists.txt
View file @
75af3d19
...
...
@@ -28,6 +28,7 @@ add_executable(castorUnitTests
castorUnitTests.cpp
../castor/exception/ExceptionTest.cpp
../castor/log/LoggerImplementationTest.cpp
../castor/log/ParamTest.cpp
../castor/server/DaemonTest.cpp
../castor/tape/tapeserver/SCSI/DeviceTest.cpp
../castor/tape/tapeserver/SCSI/StructuresTest.cpp
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment