<commit_before>// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.

#include "../func/func-common.h"
#include "../../include/librealsense2/hpp/rs_frame.hpp"
#include <iostream>

using namespace rs2;

TEST_CASE("test video_stream_profile operator==", "[live]")
{
    // Test that for 2 video_stream_profile objects, if width and height are different
    // then, video_stream_profile.operator== returns false.

    auto devices = find_devices_by_product_line_or_exit(RS2_PRODUCT_LINE_ANY_INTEL);
    auto dev = devices[0];

    auto depth_sens = dev.first< rs2::depth_sensor >();

    stream_profile profile0, profile1;
    std::vector< stream_profile > stream_profiles;
    REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
    REQUIRE_NOTHROW(stream_profiles.size() > 1);
    profile0 = stream_profiles[0];
    video_stream_profile vprofile0 = profile0.as<video_stream_profile>();

    for (auto profile : stream_profiles)
    {
        if (profile == profile0)
        {
            video_stream_profile vprofile = profile.as<video_stream_profile>();
            if (vprofile0.width() == vprofile.width() &&
                vprofile0.height() == vprofile.height())
            {
                REQUIRE(vprofile0 == vprofile);
            }<commit_msg>quit test if no device found or if device has no depth profile.<commit_after>// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.

#include "../func/func-common.h"
#include "../../include/librealsense2/hpp/rs_frame.hpp"
#include <iostream>

using namespace rs2;

TEST_CASE("test video_stream_profile operator==", "[live]")
{
    // Test that for 2 video_stream_profile objects, if width and height are different
    // then, video_stream_profile.operator== returns false.

    auto devices = find_devices_by_product_line_or_exit(RS2_PRODUCT_LINE_ANY_INTEL);
    if (devices.size() == 0) return;
    auto dev = devices[0];

    auto depth_sens = dev.first< rs2::depth_sensor >();

    stream_profile profile0, profile1;
    std::vector< stream_profile > stream_profiles;
    REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles());
    for (auto profile : stream_profiles)
    {
        if (profile.is<video_stream_profile>())
        {
            profile0 = profile;
        }
    }
    if (!profile0) return;
    video_stream_profile vprofile0 = profile0.as<video_stream_profile>();

    for (auto profile : stream_profiles)
    {
        if (!profile.is<video_stream_profile>()) continue;
        if (profile == profile0)
        {
            video_stream_profile vprofile = profile.as<video_stream_profile>();
            if (vprofile0.width() == vprofile.width() &&
                vprofile0.height() == vprofile.height())
            {
                REQUIRE(vprofile0 == vprofile);
            }
{'fraction_non_alphanumeric': 0.1151742993848257, 'fraction_numerical': 0.01572112098427888, 'mean_word_length': 3.1635846372688476, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '958091', 'n_tokens_mistral': 910, 'n_tokens_neox': 874, 'n_words': 202}