Closed Be3y4uu-K0T closed 1 year ago
I don't understand. I tried to pass the check tests on my Ubuntu VM.
$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Codename: jammy
$ git clone --recursive https://github.com/Be3y4uu-K0T/asyncio.git
$ cd asyncio
$ mkdir build-debug
$ cmake -H. -Bbuild-debug -DCMAKE_BUILD_TYPE=Debug
$ cmake --build build-debug -j2
...
[100%] Built target asyncio_ut
Everything works, but GitHub tests don't pass with the same OS.
Operating System
Ubuntu
22.04.1
LTS
What did I do wrong?
I think the problem was in this line:
// file: <asyncio/stream.h>::34L
#if SOCK_NONBLOCK != 0
Due to the definition of the macro, the comparison was always false:
// file: <bits/socket_type.h>::52L
SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as
non-blocking. */
#define SOCK_NONBLOCK SOCK_NONBLOCK
So I just replaced with if constexpr:
if constexpr (SOCK_NONBLOCK != 0) {
Pull request with regard to issue: #12