File: mm_io.cpp

package info (click to toggle)
mkvtoolnix 97.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 60,284 kB
  • sloc: cpp: 217,034; ruby: 11,453; xml: 8,125; ansic: 6,885; sh: 5,274; python: 1,041; perl: 191; makefile: 113; awk: 16; javascript: 4
file content (20 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "common/common_pch.h"

#include "common/mm_io_x.h"
#include "common/mm_file_io.h"

#include "tests/unit/init.h"
#include "tests/unit/util.h"

namespace {

TEST(MmIo, Slurp) {
  memory_cptr m;

  ASSERT_NO_THROW(m = mm_file_io_c::slurp("tests/unit/data/text/chunky_bacon.txt"));
  EXPECT_EQ("Chunky Bacon\n"s, *m);

  ASSERT_THROW(mm_file_io_c::slurp("doesnotexist"), mtx::mm_io::exception);
}

}