mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
refactor(test): clean up location of BigDataTest helper outside of main test files
This commit is contained in:
parent
14462ae233
commit
d25d3653bb
3 changed files with 5 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "storm/Big.hpp"
|
#include "storm/Big.hpp"
|
||||||
#include "test/Test.hpp"
|
#include "test/Test.hpp"
|
||||||
|
#include "test/big/BigDataTest.hpp"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
TEST_CASE("SBigAdd", "[big]") {
|
TEST_CASE("SBigAdd", "[big]") {
|
||||||
|
|
@ -570,7 +571,7 @@ TEST_CASE("SBigNot", "[big]") {
|
||||||
|
|
||||||
SECTION("bitwise negates huge value") {
|
SECTION("bitwise negates huge value") {
|
||||||
uint32_t data[] = { 0xF00DFEED, 0xBA1D, 0xBEEBBEEB, 0x12345678, 0x9ABCDEF, 0xDEADCAD, 0xD011A };
|
uint32_t data[] = { 0xF00DFEED, 0xBA1D, 0xBEEBBEEB, 0x12345678, 0x9ABCDEF, 0xDEADCAD, 0xD011A };
|
||||||
|
|
||||||
SBigFromBinary(b, data, sizeof(data));
|
SBigFromBinary(b, data, sizeof(data));
|
||||||
SBigNot(a, b);
|
SBigNot(a, b);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,2 @@
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include "test/Test.hpp"
|
#include "test/Test.hpp"
|
||||||
#include "storm/Big.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
BigDataTest::BigDataTest() { SBigNew(&num); }
|
|
||||||
BigDataTest::~BigDataTest() { SBigDel(num); }
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "storm/Big.hpp"
|
#include "storm/Big.hpp"
|
||||||
#include "storm/big/Ops.hpp"
|
#include "storm/big/Ops.hpp"
|
||||||
#include "test/Test.hpp"
|
#include "test/Test.hpp"
|
||||||
|
#include "test/big/BigDataTest.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
TEST_CASE("Add", "[big]") {
|
TEST_CASE("Add", "[big]") {
|
||||||
|
|
@ -115,7 +116,7 @@ TEST_CASE("Compare", "[big]") {
|
||||||
|
|
||||||
SECTION("compares 0x11111111 and 0x2222222222222222") {
|
SECTION("compares 0x11111111 and 0x2222222222222222") {
|
||||||
SBigFromUnsigned(a, 0x11111111);
|
SBigFromUnsigned(a, 0x11111111);
|
||||||
|
|
||||||
uint64_t data = 0x2222222222222222;
|
uint64_t data = 0x2222222222222222;
|
||||||
SBigFromBinary(b, reinterpret_cast<uint8_t*>(&data), sizeof(data));
|
SBigFromBinary(b, reinterpret_cast<uint8_t*>(&data), sizeof(data));
|
||||||
|
|
||||||
|
|
@ -690,7 +691,7 @@ TEST_CASE("SetOne", "[big]") {
|
||||||
|
|
||||||
TEST_CASE("SetZero", "[big]") {
|
TEST_CASE("SetZero", "[big]") {
|
||||||
BigDataTest num;
|
BigDataTest num;
|
||||||
|
|
||||||
SECTION("sets buffer to zero") {
|
SECTION("sets buffer to zero") {
|
||||||
SBigFromUnsigned(num, 0x12345678);
|
SBigFromUnsigned(num, 0x12345678);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue