def test_get_enums_with_all_vals(self): define_enum('TestEnum', ['a'], 1, 2, True) self.assertEqual( get_enums(), '#define ENUMS_INIT \\\n{"TestEnum", {1, 2, true, false, {{"a", a}}}}\n' )
def test_get_enums_with_only_default_vals(self): define_enum('TestEnum', ['a', 'b']) self.assertEqual( get_enums(), '#define ENUMS_INIT \\\n' '{"TestEnum", {0, 0, false, false, {{"a", a}, {"b", b}}}}\n')
from asylo.platform.system_call.type_conversions.types_parse_functions import set_klinux_prefix from asylo.platform.system_call.type_conversions.types_parse_functions import write_output include("fcntl.h") include("netdb.h") include("netinet/tcp.h") include("stdint.h") include("sys/inotify.h") include("sys/socket.h") set_klinux_prefix("kLinux") set_bridge_prefix("bridge") define_enum(name="FileStatusFlag", values=[ "O_RDONLY", "O_WRONLY", "O_RDWR", "O_CREAT", "O_APPEND", "O_EXCL", "O_TRUNC", "O_NONBLOCK", "O_DIRECT", "O_CLOEXEC" ], multi_valued=True) define_enum(name="FileModeFlag", values=[ "S_IFMT", "S_IFDIR", "S_IFCHR", "S_IFBLK", "S_IFREG", "S_IFIFO", "S_IFLNK", "S_IFSOCK", "S_ISUID", "S_ISGID", "S_ISVTX", "S_IRUSR", "S_IWUSR", "S_IXUSR", "S_IRGRP", "S_IWGRP", "S_IXGRP", "S_IRWXG", "S_IROTH", "S_IWOTH", "S_IXOTH", "S_IRWXO" ], multi_valued=True) define_enum(name="FcntlCommand", values=[
from asylo.platform.system_call.type_conversions.types_parse_functions import set_bridge_prefix from asylo.platform.system_call.type_conversions.types_parse_functions import set_klinux_prefix from asylo.platform.system_call.type_conversions.types_parse_functions import write_output include("fcntl.h") include("netdb.h") include("netinet/tcp.h") include("stdint.h") include("sys/socket.h") set_klinux_prefix("kLinux") set_bridge_prefix("bridge") define_enum(name="FileStatusFlag", values=[ "O_RDONLY", "O_WRONLY", "O_RDWR", "O_CREAT", "O_APPEND", "O_EXCL", "O_TRUNC", "O_NONBLOCK", "O_DIRECT", "O_CLOEXEC" ], multi_valued=True) define_enum(name="FcntlCommand", values=[ "F_GETFD", "F_SETFD", "F_GETFL", "F_SETFL", "F_GETPIPE_SZ", "F_SETPIPE_SZ" ], default_value_host=-1, default_value_newlib=-1) define_enum(name="AfFamily", values=[ "AF_UNIX", "AF_LOCAL", "AF_INET", "AF_AX25", "AF_IPX", "AF_APPLETALK", "AF_X25", "AF_ATMPVC", "AF_INET6", "AF_DECnet",
include("fcntl.h") include("netdb.h") include("netinet/tcp.h") include("stdint.h") include("sys/inotify.h") include("sys/socket.h") include("errno.h") include("time.h") include("unistd.h") set_klinux_prefix("kLinux") define_enum(name="FileStatusFlag", values=[ "O_RDONLY", "O_WRONLY", "O_RDWR", "O_CREAT", "O_APPEND", "O_EXCL", "O_TRUNC", "O_NONBLOCK", "O_DIRECT", "O_CLOEXEC" ], multi_valued=True) define_enum(name="FileModeFlag", values=[ "S_IFMT", "S_IFDIR", "S_IFCHR", "S_IFBLK", "S_IFREG", "S_IFIFO", "S_IFLNK", "S_IFSOCK", "S_ISUID", "S_ISGID", "S_ISVTX", "S_IRUSR", "S_IWUSR", "S_IXUSR", "S_IRGRP", "S_IWGRP", "S_IXGRP", "S_IRWXG", "S_IROTH", "S_IWOTH", "S_IXOTH", "S_IRWXO" ], multi_valued=True) define_enum(name="FcntlCommand", values=[