summaryrefslogtreecommitdiff
path: root/test/fs/extfs_test.cpp
blob: 46149e9a281fa38a16c6c9bf2c927493612a9481 (plain)
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
28
29
30
31
32
33
34
35
36
37
#include "fs/extfs.hpp"

#include <cute/cute.h>
#include <cute/cute_runner.h>
#include <cute/ostream_listener.h>
#include <cute/xml_listener.h>

void construction_with_inexistent_file_creates_extfs_that_is_not_open()
  {
  auto && disk = fs::extfs{"./THIS_DISK_DOES_NOT_EXIST"};
  ASSERT(!disk.open());
  }

void non_open_file_system_has_no_label()
  {
  auto && disk = fs::extfs{"./THIS_DISK_DOES_NOT_EXIST"};
  ASSERT(!disk.has_label());
  }

void non_open_file_system_has_empty_label()
  {
  auto && disk = fs::extfs{"./THIS_DISK_DOES_NOT_EXIST"};
  ASSERT_EQUAL("", disk.label());
  }

int main(int argc, char * argv[])
  {
  auto tests = cute::suite{
    CUTE(construction_with_inexistent_file_creates_extfs_that_is_not_open),
    CUTE(non_open_file_system_has_no_label),
    CUTE(non_open_file_system_has_empty_label)
  };

  cute::xml_file_opener resultFile{argc, argv};
  cute::xml_listener<cute::ostream_listener<>> listener{resultFile.out};
  return !cute::makeRunner(listener, argc, argv)(tests, "fs::extfs tests");
  }