Skip to content

Commit

Permalink
Add basic status_builder test
Browse files Browse the repository at this point in the history
  • Loading branch information
lokitoth committed Aug 23, 2022
1 parent f2f4b3c commit f7c42a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_executable(vw-unit-test.out
slates_parser_test.cc
slates_test.cc
stable_unique_test.cc
status_builder_test.cc
tag_utils_test.cc
test_common.cc
test_common.h
Expand Down
22 changes: 22 additions & 0 deletions test/unit_test/status_builder_test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) by respective owners including Yahoo!, Microsoft, and
// individual contributors. All rights reserved. Released under a BSD (revised)
// license as described in the file LICENSE.
#include <boost/test/unit_test.hpp>

#include "vw/core/api_status.h"
#include "vw/core/error_constants.h"

namespace err = VW::experimental::error_code;
using api_status = VW::experimental::api_status;

int testfn()
{
api_status s;
RETURN_ERROR_LS(&s, not_implemented) << "Error msg: " << 5;
}

BOOST_AUTO_TEST_CASE(status_builder_usage)
{
const auto scode = testfn();
BOOST_CHECK_EQUAL(scode, err::not_implemented);
}

0 comments on commit f7c42a2

Please sign in to comment.