summaryrefslogtreecommitdiff
path: root/libparted/tests/label.c
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2007-04-19 21:30:53 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2007-04-19 21:30:53 -0300
commitcba3a64fb1744f545c373594c8795a4da30558c4 (patch)
treefd40e767f50e5cf6bf6c5dc2f5577e9a9bda4400 /libparted/tests/label.c
parenta46cc7578fd2ff478b6e83850e06b73fe42911b1 (diff)
downloadparted-cba3a64fb1744f545c373594c8795a4da30558c4.tar.gz
[tests] Add _test_exception_handler to fail every time an exception is raised
Sometimes parts of code raises exceptions and this shouldn't happen on tests. To ensure we catch them a specific exception handler has been implemented. The handler usage is very easy. You just need to put the following code at testsuite main method: ... /* Fail when an exception is raised */ ped_exception_set_handler (_test_exception_handler); ... Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'libparted/tests/label.c')
-rw-r--r--libparted/tests/label.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libparted/tests/label.c b/libparted/tests/label.c
index 6016365..4d04753 100644
--- a/libparted/tests/label.c
+++ b/libparted/tests/label.c
@@ -98,6 +98,9 @@ main (void)
TCase* tcase_basic = tcase_create ("Create");
TCase* tcase_clone = tcase_create ("Clone");
+ /* Fail when an exception is raised */
+ ped_exception_set_handler (_test_exception_handler);
+
tcase_add_checked_fixture (tcase_basic, create_disk, destroy_disk);
tcase_add_test (tcase_basic, test_create_label);
/* Disable timeout for this test */