udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
test.c File Reference
`#include "config.h"`
`#include <stdarg.h>`
`#include <stddef.h>`
`#include <setjmp.h>`
`#include <cmocka.h>`
`#include <unistd.h>`
`#include <stdio.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <sys/wait.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <fcntl.h>`
`#include <time.h>`
Include dependency graph for test.c:

Go to the source code of this file.

## Macros
#define | NO_ERR 0
#define | ERR_FIXED 1
#define | ERR_UNFIXED 4
#define | PROG_ERR 8
#define | WRONG_PARS 16
#define | USER_INTERRUPT 32

## Functions
int | fsck_wrapper (const char *medium, char *const args, char *const argB)
| UDF fsck exec wrapper for simplified test writing. More...
static void | blank_pass (void **state)
static void | blank_fail (void **state)
static void | bs2048_dirty_file_tree_1 (void **state)
| Test against unfinished write operation. Medium was not more used. More...
static void | bs2048_dirty_file_tree_2 (void **state)
| Test against unfinished write operation. After that, another file was deleted. More...
static void | bs2048_dirty_file_tree_3 (void **state)
| Test against unfinished write operation. After that, more files were written. More...
static void | bs2048_clean (void **state)
| This medium should be clean, so this is test for positive result. More...
static void | bs2048_apple_r0260 (void **state)
| This medium should be clean, but too new. Should fail. More...
static void | bs2048_apple_r0150 (void **state)
| This medium should be clean. More...
static void | bs512_windows7 (void **state)
| Test against UDF from Windows. More...
static void | bs2048_udfclient_075 (void **state)
| Test against udfclient 0.7.5. More...
static void | bs2048_udfclient_077 (void **state)
| Test against udfclient 0.7.7. More...
static void | bs512_blocksize_detection_test (void **state)
| Blocksize detection test. More...
static void | bs1024_blocksize_detection_test (void **state)
| Blocksize detection test. More...
static void | bs2048_blocksize_detection_test (void **state)
| Blocksize detection test. More...
static void | bs4096_blocksize_detection_test (void **state)
| Blocksize detection test. More...
static void | bs1024_unclosed_medium (void **state)
| Unclosed medium check. More...
static void | bs512_defect_primary_vds (void **state)
| Defective primary VDS. More...
static void | bs2048_defect_avdp1 (void **state)
| Defective AVDP1. More...
static void | bs512_crossplatform_1 (void **state)
| Crosplatform medium test no. 1. More...
static void | bs512_crossplatform_2 (void **state)
| Crosplatform medium test no. 2. More...
static void | bs512_crossplatform_3 (void **state)
| Crosplatform medium test no. 3. More...
static void | bs512_crossplatform_4 (void **state)
| Crosplatform medium test no. 4. More...
static void | bs512_crossplatform_5 (void **state)
| Crosplatform medium test no. 5. More...
static void | bs512_crossplatform_6 (void **state)
| Crosplatform medium test no. 6. More...
static void | bs512_crossplatform_7 (void **state)
| Crosplatform medium test no. 7. More...
int | main (void)

## Macro Definition Documentation

#define ERR_FIXED 1

Definition at line 21 of file test.c.

#define ERR_UNFIXED 4

Definition at line 22 of file test.c.

#define NO_ERR 0

Definition at line 20 of file test.c.

#define PROG_ERR 8

Definition at line 23 of file test.c.

#define USER_INTERRUPT 32

Definition at line 25 of file test.c.

#define WRONG_PARS 16

Definition at line 24 of file test.c.

## Function Documentation

static void blank_fail | ( | void ** | state | ) |
| static

Definition at line 111 of file test.c.

static void blank_pass | ( | void ** | state | ) |
| static

Definition at line 105 of file test.c.

static void bs1024_blocksize_detection_test | ( | void ** | state | ) |
| static

Blocksize detection test.

Note
  Blocksize: 1024
  Revision: 1.50

Definition at line 254 of file test.c.

static void bs1024_unclosed_medium | ( | void ** | state | ) |
| static

Unclosed medium check.

Note
  Blocksize: 1024
  Revision: 1.50

Definition at line 290 of file test.c.

static void bs2048_apple_r0150 | ( | void ** | state | ) |
| static

This medium should be clean.

Note
  Blocksize: 2048
  Revision: 1.50
  Apple UDF

Definition at line 194 of file test.c.

static void bs2048_apple_r0260 | ( | void ** | state | ) |
| static

This medium should be clean, but too new. Should fail.

Note
  Blocksize: 2048
  Revision: 2.60

Definition at line 182 of file test.c.

static void bs2048_blocksize_detection_test | ( | void ** | state | ) |
| static

Blocksize detection test.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 266 of file test.c.

static void bs2048_clean | ( | void ** | state | ) |
| static

This medium should be clean, so this is test for positive result.

Note
  Blocksize: 2048
  Revisiob: 2.01

Definition at line 171 of file test.c.

static void bs2048_defect_avdp1 | ( | void ** | state | ) |
| static

Defective AVDP1.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 317 of file test.c.

static void bs2048_dirty_file_tree_1 | ( | void ** | state | ) |
| static

Test against unfinished write operation. Medium was not more used.

Result of this is broken LVID's free space, UUID, timestamp and SBD.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 125 of file test.c.

static void bs2048_dirty_file_tree_2 | ( | void ** | state | ) |
| static

Test against unfinished write operation. After that, another file was deleted.

Result of this is broken LVID's free space, UUID, timestamp and SBD.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 141 of file test.c.

static void bs2048_dirty_file_tree_3 | ( | void ** | state | ) |
| static

Test against unfinished write operation. After that, more files were written.

It resulted in broken UUIDs at them (all newer files were set UUID=0, also LVID timestamp was old.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 158 of file test.c.

static void bs2048_udfclient_075 | ( | void ** | state | ) |
| static

Test against udfclient 0.7.5.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 218 of file test.c.

static void bs2048_udfclient_077 | ( | void ** | state | ) |
| static

Test against udfclient 0.7.7.

Note
  Blocksize: 2048
  Revision: 2.01

Definition at line 230 of file test.c.

static void bs4096_blocksize_detection_test | ( | void ** | state | ) |
| static

Blocksize detection test.

Note
  Blocksize: 4096
  Revision: 2.01

Definition at line 278 of file test.c.

static void bs512_blocksize_detection_test | ( | void ** | state | ) |
| static

Blocksize detection test.

Note
  Blocksize: 512
  Revision: 1.50

Definition at line 242 of file test.c.

static void bs512_crossplatform_1 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 1.

Clean medium right from MS Windows 7

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 333 of file test.c.

static void bs512_crossplatform_2 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 2.

Broken file tree

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 347 of file test.c.

static void bs512_crossplatform_3 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 3.

CHKDSK broken medium

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 363 of file test.c.

static void bs512_crossplatform_4 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 4.

Serial numbers broken (Linux / Win noncompatibility)

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 379 of file test.c.

static void bs512_crossplatform_5 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 5.

Serial numbers broken afterfix write

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 395 of file test.c.

static void bs512_crossplatform_6 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 6.

AED test case at directory .git/objects

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 409 of file test.c.

static void bs512_crossplatform_7 | ( | void ** | state | ) |
| static

Crosplatform medium test no. 7.

Another medium from Win7

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 425 of file test.c.

static void bs512_defect_primary_vds | ( | void ** | state | ) |
| static

Defective primary VDS.

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 303 of file test.c.

static void bs512_windows7 | ( | void ** | state | ) |
| static

Test against UDF from Windows.

Note
  Blocksize: 512
  Revision: 2.01

Definition at line 206 of file test.c.

int fsck_wrapper | ( | const char * | medium,
|  | char *const | args,
|  | char *const | argB
| ) |  |

UDF fsck exec wrapper for simplified test writing.

This function wraps fork/exec around udfffsck calling. Expected path differs based on define BASIC_TESTS (udf-samples) or EXTRA_TESTS (udf-samples-extra)

Returns
  udffsck exit code

Parameters

  [in] | medium | name of tested medium. All mediums need to be at ../../udf-samples(-extra)/—MEDIUM NAME HERE—.img format
  [in] | args | non-parametric input arguments
  [in] | argsB | blocksize parameter. Should be "-B 2048" or something like that

Definition at line 38 of file test.c.

int main | ( | void |  | ) |

Definition at line 433 of file test.c.