[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/005 d763c34 04/10: Clean up
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/005 d763c34 04/10: Clean up |
Date: |
Thu, 21 Jan 2021 17:48:15 -0500 (EST) |
branch: valyuta/005
commit d763c3451f757ade95a23e77b2878c1de057a174
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Clean up
---
currency.hpp | 7 +------
currency_test.cpp | 13 +------------
2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/currency.hpp b/currency.hpp
index f2a7dea..45e11d7 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -24,8 +24,6 @@
#include "config.hpp"
-#include "so_attributes.hpp" // CURRENCY !! iff a separate TU is ever wanted
-
#include <ostream>
#include <vector>
@@ -42,8 +40,6 @@ using currency = double;
inline currency from_cents(double z) {return z / 100.0;}
-// CURRENCY !! Rename these both to 'dblize'.
-
inline double dblize(currency z) {return z;}
inline std::vector<double> dblize(std::vector<currency> const& z)
@@ -57,8 +53,7 @@ inline std::vector<double> dblize(std::vector<currency>
const& z)
class raw_cents {}; // Tag class.
-// CURRENCY !! "LMI_SO" iff some part eventually becomes a TU.
-class LMI_SO currency
+class currency
{
friend class currency_test;
template<typename> friend class round_to;
diff --git a/currency_test.cpp b/currency_test.cpp
index 54112f4..5393d6d 100644
--- a/currency_test.cpp
+++ b/currency_test.cpp
@@ -40,7 +40,6 @@ class currency_test
static void test();
private:
- static void test_something();
static void test_default_ctor();
static void test_copy_ctor();
static void test_explicit_ctor();
@@ -60,7 +59,6 @@ class currency_test
void currency_test::test()
{
- test_something();
test_default_ctor();
test_copy_ctor();
test_explicit_ctor();
@@ -240,16 +238,8 @@ void currency_test::test_quodlibet()
BOOST_TEST_EQUAL(b2, b3);
}
-// !! actually tests nothing--expunge
-void currency_test::test_something()
-{
-// Figure out what to do about this:
-// currency a1(3.14);
-// It seems best to provide no converting ctor:
-// currency a1(3.25);
-
+// CURRENCY !! Ideas for testing overflow or underflow.
#if 0
- // This is curious, but may not belong here.
// double big_num = nonstd::power(2.0, 53);
double big_num = 1.0e100;
currency::data_type big_int1 = 1.0 * big_num;
@@ -276,7 +266,6 @@ std::cout << big_int3 << '\n' << 1.0e102 << '\n' <<
big_int3 - 1.0e102 << std::e
,"Cannot cast infinite to integral."
);
#endif // 0
-}
int test_main(int, char*[])
{
- [lmi-commits] [lmi] valyuta/005 updated (133d646 -> 9e42155), Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 d763c34 04/10: Clean up,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/005 2712277 02/10: Default class currency's special member functions, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 86cba7f 09/10: Temporarily don't use currency class, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 7f6a453 01/10: Revert "Partially revert the last commit", Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 c0a93cf 03/10: Reorder currency unit tests, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 e40980b 05/10: Optionally detect nonintegral cents at run time, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 61396fd 06/10: Expunge the unclean macro just added, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 4b0bf87 07/10: Detect nonintegral cents along every path, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 6767160 08/10: Temporarily don't use cents, Greg Chicares, 2021/01/21
- [lmi-commits] [lmi] valyuta/005 9e42155 10/10: Undo temporary changes: use currency class with cents, Greg Chicares, 2021/01/21