public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/test/api percent.c
@ 2010-12-20 12:29 zkabelac
0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2010-12-20 12:29 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2010-12-20 12:29:39
Modified files:
test/api : percent.c
Log message:
Move var declarations to function begining
As assert macro jumps to 'bad:' label - we need vg initialized.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/api/percent.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
--- LVM2/test/api/percent.c 2010/12/14 23:20:59 1.1
+++ LVM2/test/api/percent.c 2010/12/20 12:29:39 1.2
@@ -4,16 +4,21 @@
int main(int argc, char *argv[])
{
- lvm_t handle = lvm_init(NULL);
+ lvm_t handle;
+ vg_t vg = NULL;
+ lv_t lv;
+ struct lvm_property_value v;
+
+ handle = lvm_init(NULL);
assert(handle);
- vg_t vg = lvm_vg_open(handle, argv[1], "r", 0);
+ vg = lvm_vg_open(handle, argv[1], "r", 0);
assert(vg);
- lv_t lv = lvm_lv_from_name(vg, "snap");
+ lv = lvm_lv_from_name(vg, "snap");
assert(lv);
- struct lvm_property_value v = lvm_lv_get_property(lv, "snap_percent");
+ v = lvm_lv_get_property(lv, "snap_percent");
assert(v.is_valid);
assert(v.value.integer == PERCENT_0);
^ permalink raw reply [flat|nested] 3+ messages in thread
* LVM2/test/api percent.c
@ 2011-01-03 15:07 mornfall
0 siblings, 0 replies; 3+ messages in thread
From: mornfall @ 2011-01-03 15:07 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mornfall@sourceware.org 2011-01-03 15:07:40
Modified files:
test/api : percent.c
Log message:
Use system assert in test/api/percent.c, for now.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/api/percent.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
--- LVM2/test/api/percent.c 2010/12/21 01:14:34 1.3
+++ LVM2/test/api/percent.c 2011/01/03 15:07:39 1.4
@@ -12,9 +12,10 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "lvm2app.h"
+#undef NDEBUG
-#define assert(x) do { if (!(x)) goto bad; } while (0)
+#include "lvm2app.h"
+#include "assert.h"
int main(int argc, char *argv[])
{
@@ -52,13 +53,4 @@
lvm_vg_close(vg);
return 0;
-
-bad:
- if (handle && lvm_errno(handle))
- fprintf(stderr, "LVM Error: %s\n", lvm_errmsg(handle));
- if (vg)
- lvm_vg_close(vg);
- if (handle)
- lvm_quit(handle);
- return 1;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* LVM2/test/api percent.c
@ 2011-01-26 21:21 zkabelac
0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-01-26 21:21 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-01-26 21:21:56
Modified files:
test/api : percent.c
Log message:
Add missing lvm_quit in test
Fix occasional confusing memory leak report in testing.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/api/percent.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
--- LVM2/test/api/percent.c 2011/01/03 15:07:39 1.4
+++ LVM2/test/api/percent.c 2011/01/26 21:21:56 1.5
@@ -37,7 +37,7 @@
assert(v.is_valid);
assert(v.value.integer == PERCENT_0);
- lv = lvm_lv_from_name(vg, "mirr");
+ lv = lvm_lv_from_name(vg, "mirr");
assert(lv);
v = lvm_lv_get_property(lv, "copy_percent");
@@ -52,5 +52,7 @@
assert(v.value.integer == 50 * PERCENT_1);
lvm_vg_close(vg);
+
+ lvm_quit(handle);
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-26 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 12:29 LVM2/test/api percent.c zkabelac
2011-01-03 15:07 mornfall
2011-01-26 21:21 zkabelac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).