Imported Upstream version 14.35.0
[platform/upstream/libzypp.git] / tests / zypp / CpeId_test.cc
index 0456095..2322b49 100644 (file)
@@ -1,4 +1,5 @@
 #include <boost/test/auto_unit_test.hpp>
+#include <iostream>
 #include "zypp/CpeId.h"
 
 using std::cout;
@@ -159,7 +160,7 @@ BOOST_AUTO_TEST_CASE(cpeid_value_valid)
 {
   static const char *const hdig = "0123456789abcdef";
 
-  for ( char ch = 0x00; ch >= 0; ++ch )
+  for ( char ch = 0; ch < CHAR_MAX; ++ch )
   {
     // cout << "==== " << unsigned(ch) << endl;
     char qchstr[] = { '\\', ch, '\0' };
@@ -361,7 +362,7 @@ BOOST_AUTO_TEST_CASE(cpeid_basics)
   CpeId( "", CpeId::noThrow );
   BOOST_CHECK_EQUAL( CpeId::NoThrowType::lastMalformed, "" );
 
-  for ( const auto & c : { CpeId(), CpeId( nullptr ), CpeId( "" ), CpeId( std::string() ) } )
+  for ( const auto & c : { CpeId(), CpeId( nullptr ), CpeId( "" ), CpeId( std::string() ), CpeId( "cpe:2.3:" ), CpeId( "cpe:/" ) } )
   {
     BOOST_CHECK( ! c );                        // evaluate false in boolean context
     BOOST_CHECK_EQUAL( c.asString(), c.asFs() );