Download third_party/ktx-src/external/fmt/test/assert-test.cc from kimjunhan/vkgs-sim: direct link, hf CLI and curl.
- Browser
- Download file 852 Bytes
-
https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/ktx-src/external/fmt/test/assert-test.cc
- Command line
-
hf download hf://kimjunhan/vkgs-sim/third_party/ktx-src/external/fmt/test/assert-test.cc
-
curl -L -o assert-test.cc https://huggingface.co/kimjunhan/vkgs-sim/resolve/main/third_party/ktx-src/external/fmt/test/assert-test.cc
852 Bytes
| // Formatting library for C++ - FMT_ASSERT test | |
| // | |
| // It is a separate test to minimize the number of EXPECT_DEBUG_DEATH checks | |
| // which are slow on some platforms. In other tests FMT_ASSERT is made to throw | |
| // an exception which is much faster and easier to check. | |
| // | |
| // Copyright (c) 2012 - present, Victor Zverovich | |
| // All rights reserved. | |
| // | |
| // For the license information refer to format.h. | |
| TEST(assert_test, fail) { | |
| EXPECT_DEBUG_DEATH(FMT_ASSERT(false, "don't panic!"), "don't panic!"); | |
| fmt::print("warning: death tests are not supported\n"); | |
| } | |
| TEST(assert_test, dangling_else) { | |
| bool test_condition = false; | |
| bool executed_else = false; | |
| if (test_condition) | |
| FMT_ASSERT(true, ""); | |
| else | |
| executed_else = true; | |
| EXPECT_TRUE(executed_else); | |
| } | |