Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:15

0001 #include "catch.hpp"
0002 #include "FWCore/Utilities/interface/Guid.h"
0003 
0004 TEST_CASE(
0005     "test edm::Guid"
0006     "[Guid]") {
0007   edm::Guid guid;
0008   auto guidString = guid.toString();
0009   auto guidBinary = guid.toBinary();
0010 
0011   SECTION("copying from string") {
0012     edm::Guid guid2(guidString, false);
0013     REQUIRE(guid == guid2);
0014     REQUIRE(guidString == guid2.toString());
0015     REQUIRE(guidBinary == guid2.toBinary());
0016   }
0017   SECTION("copy constructor") {
0018     edm::Guid guid3(guid);
0019     REQUIRE(guid == guid3);
0020     REQUIRE(guidString == guid3.toString());
0021     REQUIRE(guidBinary == guid3.toBinary());
0022   }
0023   SECTION("copy from binary") {
0024     edm::Guid guid4(guidBinary, true);
0025 
0026     REQUIRE(guid == guid4);
0027     REQUIRE(guidString == guid4.toString());
0028     REQUIRE(guidBinary == guid4.toBinary());
0029   }
0030   SECTION("uniqueness") {
0031     edm::Guid otherGuid;
0032     REQUIRE(otherGuid != guid);
0033     edm::Guid otherBinaryGuid{otherGuid.toBinary(), true};
0034     REQUIRE(otherBinaryGuid == otherGuid);
0035     REQUIRE(otherBinaryGuid != guid);
0036   }
0037 }