OpenVPN 3 Core Library
Loading...
Searching...
No Matches
test_format.cpp File Reference
#include "test_common.hpp"
#include <iostream>
#include <openvpn/common/size.hpp>
#include <openvpn/common/exception.hpp>
#include <openvpn/common/format.hpp>
#include <openvpn/common/ostream.hpp>
Include dependency graph for test_format.cpp:

Go to the source code of this file.

Classes

class  MyObj
 

Functions

 OPENVPN_OSTREAM (MyObj, to_string)
 
 TEST (misc, format)
 
template<typename... Args>
std::string pfmt (const std::string &fmt, Args... args)
 
void perf ()
 

Variables

const std::string expected
 

Function Documentation

◆ OPENVPN_OSTREAM()

OPENVPN_OSTREAM ( MyObj  ,
to_string   
)

◆ perf()

void perf ( )

Definition at line 120 of file test_format.cpp.

◆ pfmt()

template<typename... Args>
std::string pfmt ( const std::string &  fmt,
Args...  args 
)
inline

Definition at line 109 of file test_format.cpp.

Here is the caller graph for this function:

◆ TEST()

TEST ( misc  ,
format   
)

Definition at line 55 of file test_format.cpp.

Variable Documentation

◆ expected

const std::string expected
Initial value:
= "7\n"
"foo\n"
"bar\n"
"3.141593\n"
"3\n"
"1\n"
"0\n"
"pi is not 3 nor is it 7 ; it is 3.14159 ...\n"
"pi is 'not' 3 nor is it 7 ; it is 3.141593... (and has 99% less fat!)\n"
"the year is 2015 and the weather is \"partly cloudy\"\n"
"where am I? is it still 2015?\n"
"no, it's 1666... bring out yer dedd?\n"
"save 20%!\n"
"no wait... save? 99.9999%!\n"
"extra argument is here\n"
"is the question true or false?\n"
"more extra arguments are here\n"
"null string ''\n"
"nullptr 'nullptr'\n"
"foo=bar non const\n"
"EX1: bad foo\n"
"EX2: this prog is done 4 U\n"

Definition at line 32 of file test_format.cpp.