source: MondoRescue/branches/2.2.9/mondo/test/test-mountlist.c@ 2202

Last change on this file since 2202 was 2202, checked in by Bruno Cornec, 15 years ago
  • Remove useless function look_for_weird_formats
  • Adds a test program for mountlist management to find a seg. fault bug when using a large mountlist file
  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#include <stdio.h>
2#include "my-stuff.h"
3#include "../common/mondostructures.h"
4#include "../common/libmondo.h"
5#include "../mondorestore/mondorestore.h"
6
7extern void twenty_seconds_til_yikes(void);
8
9/* Reference to global bkpinfo */
10struct s_bkpinfo *bkpinfo;
11
12extern bool g_text_mode;
13extern FILE *g_fprep;
14extern double g_kernel_version;
15extern int g_partition_table_locked_up;
16extern int g_noof_rows;
17
18bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
19bool g_I_have_just_nuked = FALSE;
20char *g_isodir_device;
21char *g_isodir_format;
22char *g_biggielist_txt;
23char *g_filelist_full;
24char *g_filelist_imagedevs;
25char *g_imagedevs_restthese;
26
27char *g_mondo_cfg_file;
28
29char *g_mountlist_fname;
30char *g_mondo_home;
31
32char *g_getfacl;
33char *g_getfattr;
34
35extern char *MONDO_LOGFILE;
36
37void free_MR_global_filenames(void) {
38}
39
40extern int copy_from_src_to_dest(FILE * f_orig, FILE * f_archived,
41 char direction);
42
43void main() {
44
45 struct mountlist_itself *mountlist = NULL;
46 asprintf(&MONDO_LOGFILE,"/tmp/mrtest-mountlist.log");
47
48 g_loglevel = 99;
49 g_text_mode = FALSE;
50 if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
51 fatal_error("Cannot malloc mountlist");
52 }
53 malloc_libmondo_global_strings();
54
55setup_newt_stuff();
56asprintf(&g_mountlist_fname, "/tmp/mountlist.txt");
57load_mountlist(mountlist, g_mountlist_fname);
58finish(0);
59}
Note: See TracBrowser for help on using the repository browser.