Categorize tests into positive and negative
[platform/core/security/key-manager.git] / tests / test_xml-parser.cpp
index 5029306..e601550 100644 (file)
@@ -1,5 +1,5 @@
-/*
- *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
+       /*
+ *  Copyright (c) 2015-2020 Samsung Electronics Co., Ltd. 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.
@@ -22,7 +22,7 @@
 
 #include <cmath>
 #include <vector>
-#include <boost/test/unit_test.hpp>
+#include <boost_macros_wrapper.h>
 #include <parser.h>
 
 using namespace CKM;
@@ -60,7 +60,7 @@ void dummyEndCallback(const XML::Parser::ElementHandlerPtr &)
 
 BOOST_AUTO_TEST_SUITE(XML_PARSER_TEST)
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_wrong_argument)
+NEGATIVE_TEST_CASE(XmlParserTest_wrong_argument)
 {
        std::string emptyPath;
        XML::Parser parser(emptyPath);
@@ -75,34 +75,34 @@ BOOST_AUTO_TEST_CASE(XmlParserTest_wrong_argument)
        BOOST_REQUIRE(Parser::ErrorCode::ERROR_XML_PARSE_FAILED == parser.Parse());
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_no_XML_file)
+NEGATIVE_TEST_CASE(XmlParserTest_no_XML_file)
 {
        XML::Parser parser(format_test_path("i-am-not-here").c_str());
        BOOST_REQUIRE(Parser::ErrorCode::ERROR_XML_VALIDATION_FAILED == parser.Validate(
                                          format_test_path(XSD_1_okay).c_str()));
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_correct_verify)
+POSITIVE_TEST_CASE(XmlParserTest_XML1_correct_verify)
 {
        XML::Parser parser(format_test_path(XML_1_okay).c_str());
        BOOST_REQUIRE(0 == parser.Validate(format_test_path(XSD_1_okay).c_str()));
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_wrong_verify)
+NEGATIVE_TEST_CASE(XmlParserTest_XML1_wrong_verify)
 {
        XML::Parser parser(format_test_path(XML_1_wrong).c_str());
        BOOST_REQUIRE(Parser::ErrorCode::ERROR_XML_VALIDATION_FAILED == parser.Validate(
                                          format_test_path(XSD_1_okay).c_str()));
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_wrong_schema)
+NEGATIVE_TEST_CASE(XmlParserTest_XML1_wrong_schema)
 {
        XML::Parser parser(format_test_path(XML_1_okay).c_str());
        BOOST_REQUIRE(Parser::ErrorCode::ERROR_XSD_PARSE_FAILED == parser.Validate(
                                          format_test_path(XSD_1_wrong).c_str()));
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_correct_parse_incorrect_callbacks)
+NEGATIVE_TEST_CASE(XmlParserTest_XML1_correct_parse_incorrect_callbacks)
 {
        XML::Parser parser(format_test_path(XML_1_okay).c_str());
        BOOST_REQUIRE(0 == parser.Validate(format_test_path(XSD_1_okay).c_str()));
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_correct_parse_incorrect_callbacks)
        BOOST_REQUIRE(Parser::ErrorCode::PARSE_SUCCESS == parser.Parse());
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML1_correct_parse)
+POSITIVE_TEST_CASE(XmlParserTest_XML1_correct_parse)
 {
        XML::Parser parser(format_test_path(XML_1_okay).c_str());
        BOOST_REQUIRE(0 == parser.Validate(format_test_path(XSD_1_okay).c_str()));
@@ -291,7 +291,7 @@ private:
        int m_expectedSum;
 };
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML2_structure)
+POSITIVE_TEST_CASE(XmlParserTest_XML2_structure)
 {
        StructureTest parser(format_test_path(XML_2_structure).c_str());
        BOOST_REQUIRE(0 == parser.Parse());
@@ -300,7 +300,7 @@ BOOST_AUTO_TEST_CASE(XmlParserTest_XML2_structure)
                                                  parser.getExpectedSum());
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML3_encrypted_correct_parse)
+POSITIVE_TEST_CASE(XmlParserTest_XML3_encrypted_correct_parse)
 {
        XML::Parser parser(format_test_path(XML_3_encrypted).c_str());
        BOOST_REQUIRE(0 == parser.Validate(format_test_path(XSD_3_encrypted).c_str()));
@@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE(XmlParserTest_XML3_encrypted_correct_parse)
        BOOST_REQUIRE(endCallbackFlag == true);
 }
 
-BOOST_AUTO_TEST_CASE(XmlParserTest_XML4_device_key_correct_parse)
+POSITIVE_TEST_CASE(XmlParserTest_XML4_device_key_correct_parse)
 {
        XML::Parser parser(format_test_path(XML_4_device_key).c_str());
        BOOST_REQUIRE(0 == parser.Validate(format_test_path(XSD_4_device_key).c_str()));