Macros | Functions
is_absolute_filepath_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include <string>
#include "cetlib/filesystem.h"

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (is_absolute_filepath_t test)
 

Functions

 BOOST_AUTO_TEST_CASE (accept_absolute_filenames)
 
 BOOST_AUTO_TEST_CASE (reject_relative_filenames)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (is_absolute_filepath_t test)

Definition at line 1 of file is_absolute_filepath_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( accept_absolute_filenames  )

Definition at line 10 of file is_absolute_filepath_t.cc.

11 {
12  std::string const absolute1("/a/b/c.txt");
13  BOOST_TEST(cet::is_absolute_filepath(absolute1));
14  BOOST_TEST(cet::is_absolute_filepath("/a/b/ccc"));
15  BOOST_TEST(cet::is_absolute_filepath("/"));
16 
17  BOOST_TEST(!cet::is_relative_filepath(absolute1));
18  BOOST_TEST(!cet::is_relative_filepath("/a/b/ccc"));
19  BOOST_TEST(!cet::is_relative_filepath("/"));
20 }
std::string string
Definition: nybbler.cc:12
bool is_relative_filepath(std::string const &qualified_filename)
Definition: filesystem.cc:29
bool is_absolute_filepath(std::string const &qualified_filename)
Definition: filesystem.cc:23
BOOST_AUTO_TEST_CASE ( reject_relative_filenames  )

Definition at line 22 of file is_absolute_filepath_t.cc.

23 {
24  std::string const relative("a/b/c.txt");
25  BOOST_TEST(!cet::is_absolute_filepath(relative));
26  BOOST_TEST(!cet::is_absolute_filepath(""));
27  BOOST_TEST(!cet::is_absolute_filepath("."));
28  BOOST_TEST(!cet::is_absolute_filepath("../"));
29 
30  BOOST_TEST(cet::is_relative_filepath(relative));
31  BOOST_TEST(cet::is_relative_filepath(""));
32  BOOST_TEST(cet::is_relative_filepath("."));
33  BOOST_TEST(cet::is_relative_filepath("../"));
34 }
std::string string
Definition: nybbler.cc:12
bool is_relative_filepath(std::string const &qualified_filename)
Definition: filesystem.cc:29
bool is_absolute_filepath(std::string const &qualified_filename)
Definition: filesystem.cc:23