serna37's Library

Logo

C++ アルゴリズムとデータ構造のライブラリ

View the Project on GitHub serna37/library-cpp

:heavy_check_mark: 型変換のテスト
(tests/various.convert.test.cpp)

Depends on

Code

#define PROBLEM                                                                \
    "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_A"
#include "template/template.hpp"
#include "library/various/convert.hpp"
void test_conversions() {
    // int_to_char
    assert(int_to_char(4) == '4');
    assert(int_to_char(0) == '0');
    // int_to_alph
    assert(int_to_alph(0) == 'a');
    assert(int_to_alph(25) == 'z');
    // char_to_int
    assert(char_to_int('7') == 7);
    assert(char_to_int('0') == 0);
    // int_to_string
    assert(int_to_string(123LL) == "123");
    assert(int_to_string(-45LL) == "-45");
    // string_to_int
    assert(string_to_int("9876543210") == 9876543210LL);
}
/**
 * @brief 型変換のテスト
 */
void solve() {
    print("Hello World");
    test_conversions();
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus.py", line 187, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 401, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 400, in update
    raise BundleErrorAt(path, i + 1, "unable to process #include in #if / #ifdef / #ifndef other than include guards")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: template/template.hpp: line 7: unable to process #include in #if / #ifdef / #ifndef other than include guards
Back to top page