blob: 94cc1a13f04b342d90c370d7ffe4804a6ce57025 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "tools/kazoo/outputs.h"
#include "tools/kazoo/syscall_library.h"
#include "tools/kazoo/test.h"
#include "tools/kazoo/test_ir_test_various_categories.test.h"
namespace {
TEST(CategoryOutput, Simple) {
SyscallLibrary library;
ASSERT_TRUE(SyscallLibraryLoader::FromJson(k_test_various_categories, &library));
Writer writer;
ASSERT_TRUE(CategoryOutput(library, &writer));
EXPECT_EQ(writer.Out(),
R"(// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// WARNING: THIS FILE IS MACHINE GENERATED BY //tools/kazoo. DO NOT EDIT.
#define HAVE_SYSCALL_CATEGORY_blocking 1
SYSCALL_CATEGORY_BEGIN(blocking)
SYSCALL_IN_CATEGORY(categories_looper)
SYSCALL_CATEGORY_END(blocking)
#define HAVE_SYSCALL_CATEGORY_const 1
SYSCALL_CATEGORY_BEGIN(const)
SYSCALL_IN_CATEGORY(categories_two_categories)
SYSCALL_CATEGORY_END(const)
#define HAVE_SYSCALL_CATEGORY_noreturn 1
SYSCALL_CATEGORY_BEGIN(noreturn)
SYSCALL_IN_CATEGORY(categories_no_response_no_return)
SYSCALL_CATEGORY_END(noreturn)
#define HAVE_SYSCALL_CATEGORY_vdsocall 1
SYSCALL_CATEGORY_BEGIN(vdsocall)
SYSCALL_IN_CATEGORY(categories_vdsoer)
SYSCALL_IN_CATEGORY(categories_two_categories)
SYSCALL_CATEGORY_END(vdsocall)
)");
}
} // namespace