ronantakizawa/codereview-bench huggingface dataset:
Repository: block/goose
File: crates/goose/src/agents/mcp_client.rs (Rust)

Code before:
        _cancel_token: CancellationToken,
    ) -> Result<ListPromptsResult, Error> {
        Err(Error::TransportClosed)
    }

    async fn get_prompt(
        &self,
        _session_id: &str,
        _name: &str,
        _arguments: Value,
        _cancel_token: CancellationToken,
    ) -> Result<GetPromptResult, Error> {
        Err(Error::TransportClosed)
    }

    async fn subscribe(&self) -> mpsc::Receiver<ServerNotification> {
        mpsc::channel(1).1
    }

    async fn get_moim(&self, _session_id: &str) -> Option<String> {
        None
    }
}

struct ActiveSession {
    refcount: u32,
    session_id: Option<String>,
}

pub struct GooseClient {
    notification_handlers: Arc<Mutex<Vec<Sender<ServerNotification>>>>,
    provider: SharedProvider,
    /// Fallback session_id for server-initiated callbacks (e.g. sampling/createMessage)
    /// that don't include the session_id in their MCP extensions metadata.
    active_session: Mutex<ActiveSession>,
}

impl GooseClient {
    pub fn new(
        handlers: Arc<Mutex<Vec<Sender<ServerNotification>>>>,
        provider: SharedProvider,
    ) -> Self {
        GooseClient {
            notification_handlers: handlers,
            provider,
            active_session: Mutex::new(ActiveSession {
                refcount: 0,
                session_id: None,
            }),
        }
    }

Review comment (bug):
do you need the refcount? agent, mcp & session are all tied together as you say in the debug assert, so couldn't you just keep session_id around? 

Code after:
        _cancel_token: CancellationToken,
    ) -> Result<ListPromptsResult, Error> {
        Err(Error::TransportClosed)
    }

    async fn get_prompt(
        &self,
        _session_id: &str,
        _name: &str,
        _arguments: Value,
        _cancel_token: CancellationToken,
    ) -> Result<GetPromptResult, Error> {
        Err(Error::TransportClosed)
    }

    async fn subscribe(&self) -> mpsc::Receiver<ServerNotification> {
        mpsc::channel(1).1
    }

    async fn get_moim(&self, _session_id: &str) -> Option<String> {
        None
    }
}

pub struct GooseClient {
    notification_handlers: Arc<Mutex<Vec<Sender<ServerNotification>>>>,
    provider: SharedProvider,
    /// Fallback session_id for server-initiated callbacks (e.g. sampling/createMessage)
    /// that don't include the session_id in their MCP extensions metadata.
    /// Set once on first request; never cleared (the id is invariant per McpClient).
    session_id: Mutex<Option<String>>,
}

impl GooseClient {
    pub fn new(
        handlers: Arc<Mutex<Vec<Sender<ServerNotification>>>>,
        provider: SharedProvider,
    ) -> Self {
        GooseClient {
            notification_handlers: handlers,
            provider,
            session_id: Mutex::new(None),
        }
    }

    async fn set_session_id(&self, session_id: &str) {
        let mut slot = self.session_id.lock().await;
        assert!(
            slot.as_deref().is_none_or(|s| s == session_id),
            "McpClient received requests from different sessions"
        );
Repository: catchorg/Catch2
File: include/internal/catch_tostring.h (C/C++)

Code before:
/*
 *  Created by Phil on 8/5/2012.
 *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED


#include <vector>
#include <cstddef>
#include <type_traits>
#include <string>
#include "catch_compiler_capabilities.h"
#include "catch_stream.h"

#ifndef CATCH_CONFIG_STRING_VIEW
#    ifdef __has_include
#        if __has_include(<string_view>) && (CATCH_CPP17_OR_GREATER || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L))
#            define CATCH_CONFIG_STRING_VIEW
#        endif
#    endif
#endif

#ifdef CATCH_CONFIG_STRING_VIEW
#    include <string_view>
#endif

#ifdef __OBJC__
#include "catch_objc_arc.hpp"
#endif

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
#endif


// We need a dummy global operator<< so we can bring it into Catch namespace later
struct Catch_global_namespace_dummy {};
std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);


Review comment (suggestion):
This belongs to `catch_compiler_capabilities.h` and should work a bit differently (there are other similar macros there already, you can use them as a rough template).

Code after:
/*
 *  Created by Phil on 8/5/2012.
 *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */
#ifndef TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED


#include <vector>
#include <cstddef>
#include <type_traits>
#include <string>
#include "catch_compiler_capabilities.h"
#include "catch_stream.h"

#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
#include <string_view>
#endif

#ifdef __OBJC__
#include "catch_objc_arc.hpp"
#endif

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
#endif


// We need a dummy global operator<< so we can bring it into Catch namespace later
struct Catch_global_namespace_dummy {};
std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);

namespace Catch {
    // Bring in operator<< from global namespace into Catch namespace
    using ::operator<<;

    namespace Detail {

        extern const std::string unprintableString;
Repository: catchorg/Catch2
File: projects/SelfTest/UsageTests/ToStringOptional.tests.cpp (C++)

Code before:
#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
#include "catch.hpp"

#if defined(CATCH_CONFIG_CPP17_OPTIONAL)

TEST_CASE( "std::optional<int> -> toString", "[toString][optional]" ) {
    using type = std::optional<int>;
    REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
    REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
}

TEST_CASE( "std::optional<std::string> -> toString", "[toString][optional]" ) {
    using type = std::optional<std::string>;
    REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
    REQUIRE( "\"abc\"" == ::Catch::Detail::stringify( type{ "abc" } ) );
}

TEST_CASE( "std::vector<std::optional<int> > -> toString", "[toString][optional]" ) {
    using type = std::vector<std::optional<int> >;
    REQUIRE( "{ 0, { }, 2 }" == ::Catch::Detail::stringify( type{ 0, {}, 2 } ) );
}

#endif // CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL


Review comment (suggestion):
The tests also need to be tagged with `[approvals]` tag, so that they are not checked by the approval tests.

Code after:
#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
#include "catch.hpp"

#if defined(CATCH_CONFIG_CPP17_OPTIONAL)

TEST_CASE( "std::optional<int> -> toString", "[toString][optional][approvals]" ) {
    using type = std::optional<int>;
    REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
    REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
}

TEST_CASE( "std::optional<std::string> -> toString", "[toString][optional][approvals]" ) {
    using type = std::optional<std::string>;
    REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
    REQUIRE( "\"abc\"" == ::Catch::Detail::stringify( type{ "abc" } ) );
}

TEST_CASE( "std::vector<std::optional<int> > -> toString", "[toString][optional][approvals]" ) {
    using type = std::vector<std::optional<int> >;
    REQUIRE( "{ 0, { }, 2 }" == ::Catch::Detail::stringify( type{ 0, {}, 2 } ) );
}

#endif // CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
Repository: catchorg/Catch2
File: fuzzing/fuzz_TestSpecParser.cpp (C++)

Code before:
//License: Boost 1.0
//By Paul Dreik 2020

#include "catch2/internal/catch_test_spec_parser.hpp"
#include "catch2/internal/catch_tag_alias_registry.hpp"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

    Catch::TagAliasRegistry tar;
    Catch::TestSpecParser tsp(tar);

    std::string buf(Data,Data+Size);
    tsp.parse(buf);

    return 0;
}


Review comment (suggestion):
```suggestion
#include <catch2/internal/catch_test_spec_parser.hpp>
#include <catch2/internal/catch_tag_alias_registry.hpp>
```

Just a style nitpick

Code after:
//License: Boost 1.0
//By Paul Dreik 2020

#include <catch2/internal/catch_test_spec_parser.hpp>
#include <catch2/internal/catch_tag_alias_registry.hpp>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

    Catch::TagAliasRegistry tar;
    Catch::TestSpecParser tsp(tar);

    std::string buf(Data,Data+Size);
    tsp.parse(buf);

    return 0;
}
Repository: catchorg/Catch2
File: fuzzing/fuzz_XmlWriter.cpp (C++)

Code before:
//License: Boost 1.0
//By Paul Dreik 2020

#include "catch2/internal/catch_xmlwriter.hpp"

#include "NullOStream.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

    std::string buf(Data,Data+Size);
    NullOStream nul;
    Catch::XmlEncode encode(buf);
    encode.encodeTo(nul);
    return 0;
}




Review comment (suggestion):
```suggestion
#include <catch2/internal/catch_xmlwriter.hpp>
```

As above.

Code after:
//License: Boost 1.0
//By Paul Dreik 2020

#include <catch2/internal/catch_xmlwriter.hpp>

#include "NullOStream.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

    std::string buf(Data,Data+Size);
    NullOStream nul;
    Catch::XmlEncode encode(buf);
    encode.encodeTo(nul);
    return 0;
}
Repository: catchorg/Catch2
File: fuzzing/fuzz_textflow.cpp (C++)

Code before:
//License: Boost 1.0
//By Paul Dreik 2020

#include "catch2/internal/catch_textflow.hpp"

#include "NullOStream.h"

#include <string>
#include <string_view>


template<class Callback>
void split(const char *Data, size_t Size, Callback callback) {

    using namespace std::literals;
    constexpr auto sep="\n~~~\n"sv;

    std::string_view remainder(Data,Size);
    for (;;) {
        auto pos=remainder.find(sep);
        if(pos==std::string_view::npos) {
            //not found. use the remainder and exit
            callback(remainder);
            return;
        } else {
            //found. invoke callback on the first part, then proceed with the rest.
            callback(remainder.substr(0,pos));
            remainder=remainder.substr(pos+sep.size());
        }

Review comment (suggestion):
```suggestion
#include <catch2/internal/catch_textflow.hpp>
```

Code after:
//License: Boost 1.0
//By Paul Dreik 2020

#include <catch2/internal/catch_textflow.hpp>

#include "NullOStream.h"

#include <string>
#include <string_view>


template<class Callback>
void split(const char *Data, size_t Size, Callback callback) {

    using namespace std::literals;
    constexpr auto sep="\n~~~\n"sv;

    std::string_view remainder(Data,Size);
    for (;;) {
        auto pos=remainder.find(sep);
        if(pos==std::string_view::npos) {
            //not found. use the remainder and exit
            callback(remainder);
            return;
        } else {
            //found. invoke callback on the first part, then proceed with the rest.
            callback(remainder.substr(0,pos));
            remainder=remainder.substr(pos+sep.size());
        }
Repository: catchorg/Catch2
File: fuzzing/NullOStream.h (C/C++)

Code before:
#pragma once

#include <iostream>

// from https://stackoverflow.com/a/8244052
class NullStreambuf : public std::streambuf {
  char dummyBuffer[64];

protected:
  virtual int overflow(int c) override final;
};

class NullOStream final : private NullStreambuf, public std::ostream {
public:
  NullOStream() : std::ostream(this) {}
  NullStreambuf *rdbuf() { return this; }
  virtual void avoidOutOfLineVirtualCompilerWarning();
};




Review comment (suggestion):
```suggestion
#include <ostream>
#include <streambuf>
```

Code after:
#pragma once

#include <ostream>
#include <streambuf>

// from https://stackoverflow.com/a/8244052
class NullStreambuf : public std::streambuf {
  char dummyBuffer[64];

protected:
  virtual int overflow(int c) override final;
};

class NullOStream final : private NullStreambuf, public std::ostream {
public:
  NullOStream() : std::ostream(this) {}
  NullStreambuf *rdbuf() { return this; }
  virtual void avoidOutOfLineVirtualCompilerWarning();
};
Repository: catchorg/Catch2
File: tools/scripts/checkLicense.py (Python)

Code before:
#!/usr/bin/env python3
import os
import sys


def extract_license(split_license):
    assert split_license != None

    license = ""

    for line in split_license:
        license += line

    return license


def get_license():
    f = open("src/catch2/catch_all.hpp", "r")
    license = extract_license(f.readlines()[0:7])
    f.close()
    return license


def check_license(license):
    failed = 0
    base_dir = "src/catch2/"

    # The _ represents the list of directories in base_dir
    for root, _, files in os.walk(base_dir):
        for file in files:
            f = open(root + "/" + file, "r")
            file_license = ""
            split_license = extract_license(f.readlines()[0:7])

            for line in split_license:
                file_license += line

            if file_license != license:
                print("File %s does not have license" % file)

Review comment (refactor):
You can simplify this into single line, but at that point you might just get rid of the function altogether.

```suggestion
    return ''.join(split_license)
```

Code after:
#!/usr/bin/env python3
import os
import sys


def get_license():
    with open("src/catch2/catch_all.hpp", "r") as f:
        license = f.readlines()[0:7]

    return license


def check_license(license):
    failed = 0
    base_dir = "src/catch2/"

    # The _ represents the list of directories in base_dir
    for root, _, files in os.walk(base_dir):
        for file in files:
            with open(root + "/" + file, "r") as f:
                file_license = f.readlines()[0:7]

            if file_license != license:
                print("File %s does not have license" % file)
                failed = 1

    return failed


license = get_license()
status = check_license(license)
sys.exit(status)
Repository: catchorg/Catch2
File: tests/SelfTest/UsageTests/Compilation.tests.cpp (C++)

Code before:
            return { lhs.value ^ rhs.value };
        }
        explicit operator bool() const {
            return !!value;
        }

        friend std::ostream& operator<<(std::ostream& out, HasBitOperators val) {
            out << "Val: " << val.value;
            return out;
        }
    };
}

TEST_CASE("Assertion macros support bit operators and bool conversions", "[compilation][bitops]") {
    HasBitOperators lhs{ 1 }, rhs{ 2 };
    REQUIRE(lhs | rhs);
    REQUIRE_FALSE(lhs & rhs);
    REQUIRE(HasBitOperators{ 1 } & HasBitOperators{ 1 });
    REQUIRE(lhs ^ rhs);
    REQUIRE_FALSE(lhs ^ lhs);
}

namespace adl {

struct always_true {
    operator bool() const { return true; }
};

#define COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(op) \
template <class T, class U> \
auto operator op (T&&, U&&) { \
    return always_true{}; \
}

COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(==)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(!=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(|)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(&)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(^)

#undef COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR

}

TEST_CASE("User provided comparison operators", "[compilation]") {
    REQUIRE(adl::always_true{});
    REQUIRE(0 == adl::always_true{});

Review comment (suggestion):
```suggestion
    explicit operator bool() const { return true; }
```

Code after:
            return { lhs.value ^ rhs.value };
        }
        explicit operator bool() const {
            return !!value;
        }

        friend std::ostream& operator<<(std::ostream& out, HasBitOperators val) {
            out << "Val: " << val.value;
            return out;
        }
    };
}

TEST_CASE("Assertion macros support bit operators and bool conversions", "[compilation][bitops]") {
    HasBitOperators lhs{ 1 }, rhs{ 2 };
    REQUIRE(lhs | rhs);
    REQUIRE_FALSE(lhs & rhs);
    REQUIRE(HasBitOperators{ 1 } & HasBitOperators{ 1 });
    REQUIRE(lhs ^ rhs);
    REQUIRE_FALSE(lhs ^ lhs);
}

namespace {
    struct ImmovableType {
        ImmovableType() = default;

        ImmovableType(ImmovableType const&) = delete;
        ImmovableType& operator=(ImmovableType const&) = delete;
        ImmovableType(ImmovableType&&) = delete;
        ImmovableType& operator=(ImmovableType&&) = delete;

        friend bool operator==(ImmovableType const&, ImmovableType const&) {
            return true;
        }
    };
}

TEST_CASE("Immovable types are supported in basic assertions", "[compilation][.approvals]") {
    REQUIRE(ImmovableType{} == ImmovableType{});
}

namespace adl {

struct always_true {
    explicit operator bool() const { return true; }
};

#define COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(op) \
template <class T, class U> \
auto operator op (T&&, U&&) { \
    return always_true{}; \
Repository: catchorg/Catch2
File: tests/SelfTest/UsageTests/Compilation.tests.cpp (C++)

Code before:

struct always_true {
    operator bool() const { return true; }
};

#define COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(op) \
template <class T, class U> \
auto operator op (T&&, U&&) { \
    return always_true{}; \
}

COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(==)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(!=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(|)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(&)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(^)

#undef COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR

}

TEST_CASE("User provided comparison operators", "[compilation]") {
    REQUIRE(adl::always_true{});
    REQUIRE(0 == adl::always_true{});
    REQUIRE(0 != adl::always_true{});
    REQUIRE(0 < adl::always_true{});
    REQUIRE(0 > adl::always_true{});
    REQUIRE(0 <= adl::always_true{});
    REQUIRE(0 >= adl::always_true{});
    REQUIRE(0 | adl::always_true{});
    REQUIRE(0 & adl::always_true{});
    REQUIRE(0 ^ adl::always_true{});
}


Review comment (suggestion):
```suggestion
TEST_CASE("ADL universal comparison operators don't hijack expression deconstruction", "[compilation][.approvals]") {
```

Code after:
    struct ImmovableType {
        ImmovableType() = default;

        ImmovableType(ImmovableType const&) = delete;
        ImmovableType& operator=(ImmovableType const&) = delete;
        ImmovableType(ImmovableType&&) = delete;
        ImmovableType& operator=(ImmovableType&&) = delete;

        friend bool operator==(ImmovableType const&, ImmovableType const&) {
            return true;
        }
    };
}

TEST_CASE("Immovable types are supported in basic assertions", "[compilation][.approvals]") {
    REQUIRE(ImmovableType{} == ImmovableType{});
}

namespace adl {

struct always_true {
    explicit operator bool() const { return true; }
};

#define COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(op) \
template <class T, class U> \
auto operator op (T&&, U&&) { \
    return always_true{}; \
}

COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(==)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(!=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>=)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(|)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(&)
COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(^)

#undef COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR

}

TEST_CASE("ADL universal operators don't hijack expression deconstruction", "[compilation][.approvals]") {
    REQUIRE(adl::always_true{});
    REQUIRE(0 == adl::always_true{});
    REQUIRE(0 != adl::always_true{});
    REQUIRE(0 < adl::always_true{});
    REQUIRE(0 > adl::always_true{});
    REQUIRE(0 <= adl::always_true{});
Repository: catchorg/Catch2
File: tests/SelfTest/UsageTests/Misc.tests.cpp (C++)

Code before:
/*
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */

#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/internal/catch_config_wchar.hpp>

#ifdef __clang__
#   pragma clang diagnostic ignored "-Wc++98-compat"
#   pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
#endif


#include <iostream>
#include <cerrno>
#include <limits>
#include <array>
#include <tuple>

namespace {

    static const char* makeString(bool makeNull) {
        return makeNull ? nullptr : "valid string";
    }
    static bool testCheckedIf(bool flag) {
        CHECKED_IF(flag)
            return true;
    else
    return false;
    }
    static bool testCheckedElse(bool flag) {
        CHECKED_ELSE(flag)
            return false;

        return true;
    }

    static unsigned int Factorial(unsigned int number) {
        return number > 1 ? Factorial(number - 1) * number : 1;
    }

    static int f() {
        return 1;
    }


Review comment (suggestion):
Use `<catch2/internal/catch_windows_h_proxy.hpp>`, it defines the `NO_MINMAX`, `LEAN_AND_MEAN` macros etc.

Code after:
/*
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */

#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/internal/catch_config_wchar.hpp>
#include <catch2/internal/catch_windows_h_proxy.hpp>

#ifdef __clang__
#   pragma clang diagnostic ignored "-Wc++98-compat"
#   pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
#endif


#include <iostream>
#include <cerrno>
#include <limits>
#include <array>
#include <tuple>

namespace {

    static const char* makeString(bool makeNull) {
        return makeNull ? nullptr : "valid string";
    }
    static bool testCheckedIf(bool flag) {
        CHECKED_IF(flag)
            return true;
    else
    return false;
    }
    static bool testCheckedElse(bool flag) {
        CHECKED_ELSE(flag)
            return false;

        return true;
    }

    static unsigned int Factorial(unsigned int number) {
        return number > 1 ? Factorial(number - 1) * number : 1;
    }

    static int f() {
        return 1;
    }