Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shlublu committed May 23, 2020
1 parent 19ea79a commit 1121ee7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## v0.4 - XXXX-XX-XX
## v0.4 - 2020-05-23

### New features

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**ShlubluLib** is a modular, general purpose, open-source C++ library for Linux and Windows.<br />
The current version is v0.3.
**ShlubluLib** is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.<br />
The current version is v0.4.

This library consists in code I wrote for my own use and that might be useful to others. It is therefore released "as-is", just to be helpful with no
warranty of any kind (see license for further details).
Expand Down Expand Up @@ -43,7 +43,7 @@ This library currently consists in the following modules:
* `Debug`: Macros useful for developing and debugging: compilation messages, optimization control, and so on.
* `Exceptions`: Named exceptions derived from [`std::exception`](https://www.cplusplus.com/reference/exception/exception/).

The Doxygen documentation of these modules is available at [shlublulib.shlublu.org/v0.3/](http://shlublulib.shlublu.org/v0.3/).
The Doxygen documentation of these modules is available at [shlublulib.shlublu.org/v0.4/](http://shlublulib.shlublu.org/v0.4/).

Some of these modules require external libraries such as Boost or Python. Such requirements are specified
in their documentation.
Expand All @@ -62,8 +62,8 @@ it has no standardized replacement so far.
## Installation from binaries

Should you just wish to use Shlublulib as a development tool, the binary distribution can be downloaded from our website:
* [Linux x86 version](http://shlublulib.shlublu.org/dist/shlublulib-linux-v0.3.zip) ([PGP sig](http://shlublulib.shlublu.org/dist/shlublulib-linux-v0.3.zip.asc) - SHA-256: `0ae00fb99fcc1e14d9b7bcf211ef7f1fd1f8e2af8db4e4897179f76e9644c8d2`)
* [Win64 x86 version](http://shlublulib.shlublu.org/dist/shlublulib-win64-v0.3.zip) ([PGP sig](http://shlublulib.shlublu.org/dist/shlublulib-win64-v0.3.zip.asc) - SHA-256: `6762bcb2d7c16ab68cef2dd03132476d7a7533b6d18b4c57aaa196aba26cda36`)
* [Linux x86 version](http://shlublulib.shlublu.org/dist/shlublulib-linux-v0.4.zip) ([PGP sig](http://shlublulib.shlublu.org/dist/shlublulib-linux-v0.4.zip.asc) - SHA-256: `3311daeceecf5b270edab1cc7b9697f4ef23de76eabd3c1a0d7c7d433ecabb5b`)
* [Win64 x86 version](http://shlublulib.shlublu.org/dist/shlublulib-win64-v0.4.zip) ([PGP sig](http://shlublulib.shlublu.org/dist/shlublulib-win64-v0.4.zip.asc) - SHA-256: `fa06a693880864e5679fd527fe5c83185bc65039614f55d737fd20a2438ebd66`)

These archives are signed with [this PGP key](https://keyserver.ubuntu.com/pks/lookup?search=shlublu%40yahoo.fr&fingerprint=on&op=index) and contain:
* the library file to link to your client programs
Expand Down
2 changes: 1 addition & 1 deletion doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = ShlubluLib
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v0.3
PROJECT_NUMBER = v0.4

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
30 changes: 15 additions & 15 deletions tests/random/TestRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace random_Random

for (size_t ctr = 0; ctr < nbAttempts; ++ctr)
{
const auto r(Random::randomRounded(minD, maxD, stepD));
const auto r(Random::random(minD, maxD, stepD));
Assert::IsTrue(r >= minD && r <= maxD);
}

Expand All @@ -132,7 +132,7 @@ namespace random_Random

for (size_t ctr = 0; ctr < nbAttempts; ++ctr)
{
const auto r(Random::randomRounded(minI, maxI, stepI));
const auto r(Random::random(minI, maxI, stepI));
Assert::IsTrue(r >= minI && r <= maxI);
}
}
Expand All @@ -157,7 +157,7 @@ namespace random_Random

for (size_t ctr = 0; ctr < nbAttempts; ++ctr)
{
++resultsD[static_cast<size_t>(Random::randomRounded(minD, maxD, stepD))];
++resultsD[static_cast<size_t>(Random::random(minD, maxD, stepD))];
}

for (size_t slot = 0; slot < 11; ++slot)
Expand Down Expand Up @@ -186,7 +186,7 @@ namespace random_Random

for (size_t ctr = 0; ctr < nbAttempts; ++ctr)
{
++resultsI[Random::randomRounded(minI, maxI, stepI) / 10];
++resultsI[Random::random(minI, maxI, stepI) / 10];
}

for (size_t slot = 0; slot < 11; ++slot)
Expand All @@ -211,31 +211,31 @@ namespace random_Random

for (size_t i = 0; i < nbAttempts; ++i)
{
auto rD(Random::randomRounded(-100.75432, 100.18645, 0.01));
auto rD(Random::random(-100.75432, 100.18645, 0.01));
Assert::AreEqual(std::round(100.0 * rD) / 100.0, rD);

auto rIEven(Random::randomRounded(-100, 100, 2));
auto rIEven(Random::random(-100, 100, 2));
Assert::IsFalse(rIEven & 1);
}
}


TEST_METHOD(randomRoundedThrowsIfMinIsGreaterThanMax)
{
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(1.0, 0.9, 0.1); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(1.0f, 0.9f, 0.1f); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(10, 9, 1); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(10, -11, 1); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(10U, 9U, 1U); });
Assert::ExpectException<ShlubluException>([]() { Random::random(1.0, 0.9, 0.1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(1.0f, 0.9f, 0.1f); });
Assert::ExpectException<ShlubluException>([]() { Random::random(10, 9, 1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(10, -11, 1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(10U, 9U, 1U); });
}


TEST_METHOD(randomRoundedThrowsIfStepIsNegative)
{
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(1.0, 2.0, -0.1); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(1.0f, 2.0f, -0.1f); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(10, 11, -1); });
Assert::ExpectException<ShlubluException>([]() { Random::randomRounded(-10, 11, -1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(1.0, 2.0, -0.1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(1.0f, 2.0f, -0.1f); });
Assert::ExpectException<ShlubluException>([]() { Random::random(10, 11, -1); });
Assert::ExpectException<ShlubluException>([]() { Random::random(-10, 11, -1); });
}
};

Expand Down

0 comments on commit 1121ee7

Please sign in to comment.