LVM2 ./WHATS_NEW_DM libdm/regex/matcher.c test ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-02-10 13:49:30
Modified files:
. : WHATS_NEW_DM libdm/regex : matcher.c test/unit : matcher_t.c
Log message:
Add test for memory allocation failures
Replace asserts with test for failing memory allocation.
Add at least stack traces.
Index counter starts from 1 (0 reserved for error), so replacing fingerprint.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.542&r2=1.543
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/unit/matcher_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
WHATS_NEW_DM +1 -0
@@ -1,5 +1,6 @@ Version 1.02.70 - =================================== + Add test for memory allocation failures in regex matcher code. Simplify dm_task_set_geometry() and use dm_asprintf(). Set all parameters to 0 for dm_get_next_target() for NULL return. Fix fd resource leak in error path for _udev_notify_sem_create().
libdm/regex/matcher.c +107 -67
338 lines not on this page · raw message
test/unit/matcher_t.c +2 -2
@@ -58,10 +58,10 @@struct dm_regex *scanner; scanner =make_scanner (dev_patterns); -CU_ASSERT_EQUAL (dm_regex_fingerprint (scanner),0x352b6c4f ); +CU_ASSERT_EQUAL (dm_regex_fingerprint (scanner),0x7f556c09 ); scanner =make_scanner (random_patterns); -CU_ASSERT_EQUAL (dm_regex_fingerprint (scanner),0xeed8ceb8 ); +CU_ASSERT_EQUAL (dm_regex_fingerprint (scanner),0x9f11076c ); }static void test_matching (void ) {