From Fedora Project Wiki

Revision as of 08:50, 21 August 2023 by Sumantrom (talk | contribs) (Created page with "{{QA/Test_Case |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+...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

  1. Install the version of Fedora that is to be tested on a bare metal or virtual system.
  2. Install the double-conversion and its development packages using the command: sudo dnf install double-conversion double-conversion-devel.
  3. Install a C++ compiler and make utility: sudo dnf install gcc-c++ make.

How to test

  1. Create a simple C++ program that uses the double-conversion library:
  2. Write the following sample C++ program to a file named conversion_test.cpp: [gist]
  3. Compile the C++ program: g++ conversion_test.cpp -ldouble-conversion -o conversion_test
  4. Run the compiled program: ./conversion_test

Expected Results

  1. The double-conversion and double-conversion-devel packages install without error.
  2. The C++ program compiles successfully without errors.
  3. 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

  1. Test with a wider range of double values, including very small, very large, and special values (e.g., NaN, Infinity).
  2. Evaluate the performance of the conversion for large datasets.
  3. Test edge cases, like the limits of representable numbers.