File: string_util_test.cc

package info (click to toggle)
cmph 2.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,748 kB
  • sloc: ansic: 10,582; cpp: 2,429; makefile: 151; sh: 111; python: 48; xml: 5
file content (27 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "string_util.h"
#include "test.h"

using namespace cxxmph;

bool test_format() {
  string expected = " %% 4 foo 0x0A bar ";
  string foo = "foo";
  string fmt = format(" %%%% %v %v 0x%.2X bar ", 4, foo, 10);
  fail_unless(fmt == expected, "expected\n-%s-\n got \n-%s-", expected.c_str(), fmt.c_str());
  return true;
}

bool test_infoln() {
  infoln(string("%s:%d: MY INFO LINE"), __FILE__, __LINE__);
  return true;
}


bool test_macro() {
  CXXMPH_DEBUGLN("here i am")();
  return true;
}

CXXMPH_TEST_CASE(test_format)
CXXMPH_TEST_CASE(test_infoln)
CXXMPH_TEST_CASE(test_macro)