From: Dariusz Michaluk Date: Mon, 18 May 2020 13:29:37 +0000 (+0200) Subject: Add macros adding NEGATIVE_ or POSITIVE_ prefix to test name X-Git-Tag: submit/tizen/20200728.071123~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F233728%2F15;p=platform%2Fcore%2Fsecurity%2Fdevice-certificate-manager.git Add macros adding NEGATIVE_ or POSITIVE_ prefix to test name Change-Id: I3f0681ed8697b301b061778cb9e4babb81c5ab30 --- diff --git a/tests/api_test.cpp b/tests/api_test.cpp index 29a3696..2cd611b 100644 --- a/tests/api_test.cpp +++ b/tests/api_test.cpp @@ -21,13 +21,13 @@ #include #include -#include #include "device_certificate_manager.h" +#include "test_macros.h" BOOST_AUTO_TEST_SUITE(API_TEST) -BOOST_AUTO_TEST_CASE(test01_dcm_create_key_context) +POSITIVE_TEST_CASE(test01_dcm_create_key_context) { void *ctx; int ret = dcm_create_key_context(NULL, NULL, NULL, &ctx); @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(test01_dcm_create_key_context) BOOST_REQUIRE_EQUAL(ret, DCM_ERROR_NONE); } -BOOST_AUTO_TEST_CASE(test02_dcm_get_certificate_chain) +POSITIVE_TEST_CASE(test02_dcm_get_certificate_chain) { void *ctx; char *cert; @@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE(test02_dcm_get_certificate_chain) free(cert); } -BOOST_AUTO_TEST_CASE(test03_dcm_get_key_bit_length) +POSITIVE_TEST_CASE(test03_dcm_get_key_bit_length) { int ret; void *ctx; @@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE(test03_dcm_get_key_bit_length) BOOST_REQUIRE_EQUAL(ret, DCM_ERROR_NONE); } -BOOST_AUTO_TEST_CASE(test04_dcm_get_key_type) +POSITIVE_TEST_CASE(test04_dcm_get_key_type) { int ret; void *ctx; @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE(test04_dcm_get_key_type) free(key_type); } -BOOST_AUTO_TEST_CASE(test05_dcm_create_signature) +POSITIVE_TEST_CASE(test05_dcm_create_signature) { int ret; void *ctx; diff --git a/tests/test_macros.h b/tests/test_macros.h new file mode 100644 index 0000000..5459b40 --- /dev/null +++ b/tests/test_macros.h @@ -0,0 +1,25 @@ +/****************************************************************** + * + * Copyright 2020 Samsung Electronics All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************/ + +#pragma once + +#include + +#define POSITIVE_TEST_CASE(name) BOOST_AUTO_TEST_CASE(POSITIVE_ ## name) +#define NEGATIVE_TEST_CASE(name) BOOST_AUTO_TEST_CASE(NEGATIVE_ ## name) +