File: testpath.c

package info (click to toggle)
libfsoframework 0.12.0-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,640 kB
  • ctags: 8,717
  • sloc: ansic: 52,981; sh: 11,367; makefile: 819
file content (100 lines) | stat: -rw-r--r-- 2,968 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* testpath.c generated by valac 0.16.1, the Vala compiler
 * generated from testpath.vala, do not modify */

/*
 * Copyright (C) 2011-2012 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsosystem.h>
#include <stdlib.h>
#include <string.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))



void test_path_is_mount_point (void);
void test_path_is_absolute (void);
void _vala_main (gchar** args, int args_length1);
static void _test_path_is_mount_point_gcallback (void);
static void _test_path_is_absolute_gcallback (void);


void test_path_is_mount_point (void) {
	FsoFrameworkFileSystemPath* _tmp0_;
	FsoFrameworkFileSystemPath* path;
	gboolean _tmp1_ = FALSE;
	_tmp0_ = fso_framework_file_system_path_new ("/sys");
	path = _tmp0_;
	_tmp1_ = fso_framework_file_system_path_is_mount_point (path);
	g_assert (_tmp1_ == TRUE);
	_g_object_unref0 (path);
}


void test_path_is_absolute (void) {
	FsoFrameworkFileSystemPath* _tmp0_;
	FsoFrameworkFileSystemPath* path;
	FsoFrameworkFileSystemPath* _tmp1_;
	gboolean _tmp2_ = FALSE;
	FsoFrameworkFileSystemPath* _tmp3_;
	FsoFrameworkFileSystemPath* _tmp4_;
	gboolean _tmp5_ = FALSE;
	_tmp0_ = fso_framework_file_system_path_new ("/is/absolut/path");
	path = _tmp0_;
	_tmp1_ = path;
	_tmp2_ = fso_framework_file_system_path_is_absolute (_tmp1_);
	g_assert (_tmp2_ == TRUE);
	_tmp3_ = fso_framework_file_system_path_new ("is/relative/path");
	_g_object_unref0 (path);
	path = _tmp3_;
	_tmp4_ = path;
	_tmp5_ = fso_framework_file_system_path_is_absolute (_tmp4_);
	g_assert (_tmp5_ == FALSE);
	_g_object_unref0 (path);
}


static void _test_path_is_mount_point_gcallback (void) {
	test_path_is_mount_point ();
}


static void _test_path_is_absolute_gcallback (void) {
	test_path_is_absolute ();
}


void _vala_main (gchar** args, int args_length1) {
	g_test_init (&args_length1, &args, NULL);
	g_test_add_func ("/FileSystem/Path/IsMountpoint", _test_path_is_mount_point_gcallback);
	g_test_add_func ("/FileSystem/Path/IsAbsolute", _test_path_is_absolute_gcallback);
	g_test_run ();
}


int main (int argc, char ** argv) {
	g_type_init ();
	_vala_main (argv, argc);
	return 0;
}