From Fedora Project Wiki
Description
This test case ensures that the double-conversion
library provides accurate and fast conversion routines for IEEE doubles. It will validate the binary-decimal and decimal-binary conversions.
Setup
- Install the version of Fedora that is to be tested on a bare metal or virtual system.
- Install the
double-conversion
and its development packages using the command:sudo dnf install double-conversion double-conversion-devel
. - Install a C++ compiler and make utility:
sudo dnf install gcc-c++ make
.
How to test
- Create a simple C++ program that uses the
double-conversion
library: - Write the following sample C++ program to a file named
conversion_test.cpp
: [gist] - Compile the C++ program:
g++ conversion_test.cpp -ldouble-conversion -o conversion_test
- Run the compiled program:
./conversion_test
Expected Results
- The
double-conversion
anddouble-conversion-devel
packages install without error. - The C++ program compiles successfully without errors.
- The compiled program runs and correctly displays the number in its string form, then converts it back to the double form, demonstrating successful round-trip conversion.
Optional
- Test with a wider range of double values, including very small, very large, and special values (e.g., NaN, Infinity).
- Evaluate the performance of the conversion for large datasets.
- Test edge cases, like the limits of representable numbers.