Skip to content

Commit

Permalink
chore: remove more _ten namespace directly accessing (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn authored Dec 3, 2024
1 parent 15cece7 commit c7990f2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
7 changes: 3 additions & 4 deletions tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ class test_extension_2 : public ten::extension_t {
ten::ten_env_t &ten_env,
std::unique_ptr<ten::audio_frame_t> audio_frame) override {
auto cmd = ten::cmd_t::create("audio_frame_ack");
if (audio_frame->get_property_int64("_ten.bytes_per_sample") == 3 &&
audio_frame->get_property_int64("_ten.number_of_channel") == 555 &&
audio_frame->get_property_int64("_ten.data_fmt") ==
TEN_AUDIO_FRAME_DATA_FMT_INTERLEAVE) {
if (audio_frame->get_bytes_per_sample() == 3 &&
audio_frame->get_number_of_channels() == 555 &&
audio_frame->get_data_fmt() == TEN_AUDIO_FRAME_DATA_FMT_INTERLEAVE) {
ten_env.send_cmd(std::move(cmd));
}
}
Expand Down
9 changes: 5 additions & 4 deletions tests/ten_runtime/smoke/msg_test/msg_3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <string>

#include "gtest/gtest.h"
#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h"
#include "include_internal/ten_runtime/binding/cpp/ten.h"
#include "ten_utils/lib/thread.h"
#include "tests/common/client/cpp/msgpack_tcp.h"
Expand All @@ -27,11 +28,11 @@ class test_extension : public ten::extension_t {
hello_world_cmd = std::move(cmd);

// Start a timer.
std::unique_ptr<ten::cmd_t> timer_cmd = ten::cmd_timer_t::create();
std::unique_ptr<ten::cmd_timer_t> timer_cmd = ten::cmd_timer_t::create();
timer_cmd->set_dest("localhost", nullptr, nullptr, nullptr);
timer_cmd->set_property("_ten.timer_id", 55);
timer_cmd->set_property("_ten.timeout_in_us", 100);
timer_cmd->set_property("_ten.times", TIMER_TIMES);
timer_cmd->set_timer_id(55);
timer_cmd->set_timeout_in_us(100);
timer_cmd->set_times(TIMER_TIMES);

bool success = ten_env.send_cmd(std::move(timer_cmd));
EXPECT_EQ(success, true);
Expand Down
5 changes: 2 additions & 3 deletions tests/ten_runtime/smoke/video_frame_test/create_from_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ class test_extension_2 : public ten::extension_t {
ten::ten_env_t &ten_env,
std::unique_ptr<ten::video_frame_t> video_frame) override {
auto cmd = ten::cmd_t::create("video_frame_ack");
if (video_frame->get_property_int64("_ten.width") == 345 &&
video_frame->get_property_int64("_ten.pixel_fmt") ==
TEN_PIXEL_FMT_RGB24) {
if (video_frame->get_width() == 345 &&
video_frame->get_pixel_fmt() == TEN_PIXEL_FMT_RGB24) {
ten_env.send_cmd(std::move(cmd));
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/ten_runtime/smoke/video_frame_test/from_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ class test_extension_2 : public ten::extension_t {
ten::ten_env_t &ten_env,
std::unique_ptr<ten::video_frame_t> video_frame) override {
auto cmd = ten::cmd_t::create("video_frame_ack");
if (video_frame->get_property_int64("_ten.width") == 345 &&
video_frame->get_property_int64("_ten.pixel_fmt") ==
TEN_PIXEL_FMT_RGB24) {
if (video_frame->get_width() == 345 &&
video_frame->get_pixel_fmt() == TEN_PIXEL_FMT_RGB24) {
ten_env.send_cmd(std::move(cmd));
}
}
Expand Down

0 comments on commit c7990f2

Please sign in to comment.