Skip to content

Commit

Permalink
gtests: introduced test for edit.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Sep 10, 2020
1 parent dee8afb commit 00dcfaa
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/tests/CMakeLists.txt
Expand Up @@ -417,3 +417,8 @@ if(NOT client-only)
SKIP_GTEST
)
endif() # NOT client-only

bareos_add_test(
test_edit LINK_LIBRARIES bareos ${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES}
)
31 changes: 31 additions & 0 deletions core/src/tests/test_edit.cc
@@ -0,0 +1,31 @@
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2018-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
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
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#if defined(HAVE_MINGW)
#include "include/bareos.h"
#include "gtest/gtest.h"
#else
#include "gtest/gtest.h"
#include "include/bareos.h"
#endif

#include "lib/edit.h"

TEST(edit, edit) { ASSERT_EQ(str_to_uint64("1 kb"), 1024); }

0 comments on commit 00dcfaa

Please sign in to comment.