[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 246f754 10/10: In unit tests, reflect removal
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 246f754 10/10: In unit tests, reflect removal of undesirable 'default:' from 'switch' |
Date: |
Thu, 8 Feb 2018 08:40:11 -0500 (EST) |
branch: master
commit 246f754474152b247b61e902d1eb62e477f42394
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
In unit tests, reflect removal of undesirable 'default:' from 'switch'
* actuarial_table_test.cpp: Reflect change in diagnostic text.
* progress_meter_test.cpp: Remove a contrived test. The old 'default:',
although cumbersome, seemed capable of detecting typecasting abuse,
but that abuse has become UB anyway.
---
actuarial_table_test.cpp | 2 +-
progress_meter_test.cpp | 19 -------------------
2 files changed, 1 insertion(+), 20 deletions(-)
diff --git a/actuarial_table_test.cpp b/actuarial_table_test.cpp
index 6b309e2..9e13133 100644
--- a/actuarial_table_test.cpp
+++ b/actuarial_table_test.cpp
@@ -269,7 +269,7 @@ void test_precondition_failures()
BOOST_TEST_THROW
(z.values_elaborated(80, 42, e_reenter_never, 0, 0)
,std::runtime_error
- ,"Table-lookup method 0 is not valid in this context."
+ ,"Cannot use 'e_reenter_never' here."
);
}
diff --git a/progress_meter_test.cpp b/progress_meter_test.cpp
index 348c826..0a98067 100644
--- a/progress_meter_test.cpp
+++ b/progress_meter_test.cpp
@@ -36,7 +36,6 @@ class progress_meter_test
test_quiet_display_mode();
test_distinct_metered_operations();
test_empty_title_and_zero_max_count();
- test_invalid_display_mode();
test_postcondition_failure();
}
@@ -45,7 +44,6 @@ class progress_meter_test
static void test_quiet_display_mode();
static void test_distinct_metered_operations();
static void test_empty_title_and_zero_max_count();
- static void test_invalid_display_mode();
static void test_postcondition_failure();
};
@@ -164,23 +162,6 @@ void
progress_meter_test::test_empty_title_and_zero_max_count()
);
}
-void progress_meter_test::test_invalid_display_mode()
-{
- progress_meter_unit_test_stream().str("");
- int const max_count = 0;
- BOOST_TEST_THROW
- (std::shared_ptr<progress_meter> meter
- (create_progress_meter
- (max_count
- ,""
- ,progress_meter::enum_display_mode(99)
- )
- )
- ,std::runtime_error
- ,"Case 99 not found."
- );
-}
-
void progress_meter_test::test_postcondition_failure()
{
progress_meter_unit_test_stream().str("");
- [lmi-commits] [lmi] master updated (eafa74e -> 246f754), Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 9cc3f6b 05/10: Avoid passing an enum by reference, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 20e866a 06/10: Simplify an overwrought expression, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master b0576c8 02/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master e26d308 09/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 422e64a 03/10: Remove an unimplemented 'case', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 92911ca 07/10: Improve documentation, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 9797cbc 04/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 78fd8b8 01/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 246f754 10/10: In unit tests, reflect removal of undesirable 'default:' from 'switch',
Greg Chicares <=
- [lmi-commits] [lmi] master 3952bd0 08/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08