Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## [Unreleased](https://github.com/rdkcentral/firebolt-cpp-client/compare/v0.5.0...main)

### Changed
- Corrected type from integer to unsigned in TTS (uint32_t)
- **Breaking**: Aligned types with the latest specification updates:
- `integer` changed to unsigned (`uint32_t`)
- `float` changed to `double`

## [0.5.0](https://github.com/rdkcentral/firebolt-cpp-client/compare/v0.4.0...v0.5.0)

Expand Down
2 changes: 1 addition & 1 deletion include/firebolt/accessibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ClosedCaptionsSettings
struct VoiceGuidanceSettings
{
bool enabled;
float rate;
double rate;
bool navigationHints;
};

Expand Down
2 changes: 1 addition & 1 deletion include/firebolt/discovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IDiscovery
*
* @retval The status.
*/
virtual Result<bool> watched(const std::string& entityId, std::optional<float> progress,
virtual Result<bool> watched(const std::string& entityId, std::optional<double> progress,
std::optional<bool> completed, std::optional<std::string> watchedOn,
std::optional<AgePolicy> agePolicy) const = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/discovery_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DiscoveryImpl::DiscoveryImpl(Firebolt::Helpers::IHelper& helper)
{
}

Result<bool> DiscoveryImpl::watched(const std::string& entityId, std::optional<float> progress,
Result<bool> DiscoveryImpl::watched(const std::string& entityId, std::optional<double> progress,
std::optional<bool> completed, std::optional<std::string> watchedOn,
std::optional<AgePolicy> agePolicy) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/discovery_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DiscoveryImpl : public IDiscovery

~DiscoveryImpl() override = default;

Result<bool> watched(const std::string& entityId, std::optional<float> progress, std::optional<bool> completed,
Result<bool> watched(const std::string& entityId, std::optional<double> progress, std::optional<bool> completed,
std::optional<std::string> watchedOn, std::optional<AgePolicy> agePolicy) const override;

private:
Expand Down
4 changes: 2 additions & 2 deletions src/json_types/jsondata_accessibility_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class VoiceGuidanceSettings : public Firebolt::JSON::NL_Json_Basic<::Firebolt::A
void fromJson(const nlohmann::json& json) override
{
enabled_ = json["enabled"].get<bool>();
rate_ = json["rate"].get<float>();
rate_ = json["rate"].get<double>();
navigationHints_ = json["navigationHints"].get<bool>();
}
::Firebolt::Accessibility::VoiceGuidanceSettings value() const override
Expand All @@ -58,7 +58,7 @@ class VoiceGuidanceSettings : public Firebolt::JSON::NL_Json_Basic<::Firebolt::A

private:
bool enabled_;
float rate_;
double rate_;
bool navigationHints_;
};

Expand Down
4 changes: 2 additions & 2 deletions test/api_test_app/apis/discoveryDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ void DiscoveryDemo::runOption(const std::string& method)
if (method == "Discovery.watched")
{
std::string entityId = paramFromConsole("entityId", "exampleEntityId");
std::optional<float> progress = 0.5;
std::optional<double> progress = 0.5;
try
{
progress = std::stof(
progress = std::stod(
paramFromConsole("progress (percentage as (0-0.999) for VOD, number of seconds for live)", "0.5"));
}
catch (const std::exception&)
Expand Down
4 changes: 2 additions & 2 deletions test/component/accessibilityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ TEST_F(AccessibilityTest, VoiceGuidanceSettings)

ASSERT_TRUE(result) << "AccessibilityImpl::voiceGuidanceSettings() returned an error";
EXPECT_EQ((*result).enabled, expectedValue.at("enabled").get<bool>());
EXPECT_EQ((*result).rate, expectedValue.at("rate").get<float>());
EXPECT_EQ((*result).rate, expectedValue.at("rate").get<double>());
EXPECT_EQ((*result).navigationHints, expectedValue.at("navigationHints").get<bool>());
}

Expand All @@ -164,7 +164,7 @@ TEST_F(AccessibilityTest, SubscribeOnVoiceGuidanceSettingsChanged)
std::cout << "[Subscription] Accessibility voice guidance settings changed" << std::endl;

EXPECT_EQ(settings.enabled, true);
EXPECT_EQ(settings.rate, 0.8f);
EXPECT_EQ(settings.rate, 0.8);
EXPECT_EQ(settings.navigationHints, true);

{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/accessibilityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ TEST_F(AccessibilityTest, VoiceGuidanceSettings)

ASSERT_TRUE(result) << "AccessibilityImpl::voiceGuidanceSettings() returned an error";
EXPECT_EQ((*result).enabled, expectedValue["enabled"].get<bool>());
EXPECT_EQ((*result).rate, expectedValue["rate"].get<float>());
EXPECT_EQ((*result).rate, expectedValue["rate"].get<double>());
EXPECT_EQ((*result).navigationHints, expectedValue["navigationHints"].get<bool>());
}

Expand Down
4 changes: 2 additions & 2 deletions test/unit/discoveryTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST_F(DiscoveryTest, watched)
{
mock("Discovery.watched");
std::string entityId = "content123";
std::optional<float> progress = 0.75f;
std::optional<double> progress = 0.75f;
std::optional<bool> completed = true;
std::optional<std::string> watchedOn = "2024-06-01T12:00:00Z";
std::optional<Firebolt::Discovery::AgePolicy> agePolicy = Firebolt::Discovery::AgePolicy::ADULT;
Expand Down Expand Up @@ -60,7 +60,7 @@ TEST_F(DiscoveryTest, watched_payload)
return Firebolt::Result<nlohmann::json>{res};
}));
std::string entityId = "content123";
std::optional<float> progress = 0.75f;
std::optional<double> progress = 0.75f;
std::optional<bool> completed = true;
std::optional<std::string> watchedOn = "2024-06-01T12:00:00Z";
std::optional<Firebolt::Discovery::AgePolicy> agePolicy = Firebolt::Discovery::AgePolicy::ADULT;
Expand Down