mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 13:56:27 -05:00
62b0b83fd8
Updates the library from 2.2.3 to 2.3.0
27 lines
765 B
C++
27 lines
765 B
C++
// Copyright 2017 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#include <catch2/catch.hpp>
|
|
#include <math.h>
|
|
#include "common/param_package.h"
|
|
|
|
namespace Common {
|
|
|
|
TEST_CASE("ParamPackage", "[common]") {
|
|
ParamPackage original{
|
|
{"abc", "xyz"},
|
|
{"def", "42"},
|
|
{"jkl", "$$:1:$2$,3"},
|
|
};
|
|
original.Set("ghi", 3.14f);
|
|
ParamPackage copy(original.Serialize());
|
|
REQUIRE(copy.Get("abc", "") == "xyz");
|
|
REQUIRE(copy.Get("def", 0) == 42);
|
|
REQUIRE(std::abs(copy.Get("ghi", 0.0f) - 3.14f) < 0.01f);
|
|
REQUIRE(copy.Get("jkl", "") == "$$:1:$2$,3");
|
|
REQUIRE(copy.Get("mno", "uvw") == "uvw");
|
|
REQUIRE(copy.Get("abc", 42) == 42);
|
|
}
|
|
|
|
} // namespace Common
|