Ejemplo n.º 1
0
#include <catch.hpp>

#include <platform.hpp>

#include <utility>

using namespace std;

static const char *M = "[platform]";

TEST_CASE("default platform", M) {
  const Platform pl;
  REQUIRE(pl.value() == Platform::GenericPlatform);
  REQUIRE(pl.test());
}

TEST_CASE("platform from string", M) {
  SECTION("unknown")
    REQUIRE(Platform("hello") == Platform::UnknownPlatform);

  SECTION("generic")
    REQUIRE(Platform("all") == Platform::GenericPlatform);

  SECTION("generic windows")
    REQUIRE(Platform("windows") == Platform::WindowsPlatform);

  SECTION("windows 32-bit")
    REQUIRE(Platform("win32") == Platform::Win32Platform);

  SECTION("windows 64-bit")
    REQUIRE(Platform("win64") == Platform::Win64Platform);