Celeritas  0.5.0-56+6b053cd
Functions
TestMacrosImpl.cc File Reference
#include "TestMacrosImpl.hh"
#include <cstdio>
#include <cstring>
#include <string>
#include "corecel/Config.hh"
#include "corecel/Assert.hh"
#include "corecel/io/ColorUtils.hh"
#include "JsonComparer.hh"

Functions

int celeritas::testdetail::num_digits (unsigned long val)
 Number of base-10 digits in an unsigned integer. More...
 
char const * celeritas::testdetail::trunc_string (unsigned int digits, char const *str, char const *trunc)
 Return a replacement string if the given string is too long. More...
 
::testing::AssertionResult celeritas::testdetail::IsJsonEq (char const *, char const *, std::string_view expected, std::string_view actual)
 Compare two JSON objects.
 

Function Documentation

◆ num_digits()

int celeritas::testdetail::num_digits ( unsigned long  val)

Number of base-10 digits in an unsigned integer.

This function is useful for pre-calculating field widths for printing.

◆ trunc_string()

char const * celeritas::testdetail::trunc_string ( unsigned int  digits,
char const *  str,
char const *  trunc 
)

Return a replacement string if the given string is too long.

where too long means > digits digits.