TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
test_argument_parser.cpp File Reference

Tests of the argument parsing and file I/O. More...

#include "argument_parser.h"
#include <algorithm>
#include <stdexcept>
#include <string>
#include <unistd.h>
#include <vector>
#include <catch2/catch_test_macros.hpp>
Include dependency graph for test_argument_parser.cpp:

Functions

 TEST_CASE ("Test namespace")
 Test that the argument namespace recovers the input arguments provided.
 
template<typename T >
vector< T > drop_first_and_last (const vector< T > &v)
 
const char ** vector_to_array (const vector< string > &vec)
 
 TEST_CASE ("Test parsing two filenames")
 Test that the argument parser returns the correct filenames.
 
 TEST_CASE ("Test parsing three filenames")
 Test that the argument parser returns the correct filenames.
 
 TEST_CASE ("Test wrong number of file names")
 Test that the argument correctly errors with the wrong number of file names.
 
 TEST_CASE ("CL options")
 Test of the CLI options.
 

Detailed Description

Tests of the argument parsing and file I/O.

Function Documentation

◆ drop_first_and_last()

template<typename T >
vector< T > drop_first_and_last ( const vector< T > &  v)

Drop the first and last component of an std::vector (needs size > 2!!).

◆ vector_to_array()

const char ** vector_to_array ( const vector< string > &  vec)

Convert a vector of std::strings to an array of chars