File: uuid.cc

package info (click to toggle)
snapper 0.10.6-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,072 kB
  • sloc: cpp: 24,846; ansic: 1,466; sh: 1,410; makefile: 514; python: 127; ruby: 90
file content (24 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE snapper

#include <sstream>
#include <boost/test/unit_test.hpp>

#include "../snapper/AppUtil.h"

using namespace snapper;


BOOST_AUTO_TEST_CASE(test1)
{
    uint8_t value[16] = { 0x78, 0x9e, 0x39, 0xcd, 0x96, 0x7f, 0x41, 0xf0,
			  0x8a, 0x17, 0xcc, 0xc8, 0xf0, 0x00, 0x2e, 0xae };

    Uuid uuid;
    std::copy(std::begin(value), std::end(value), std::begin(uuid.value));
    std::ostringstream s;
    s << uuid;

    BOOST_CHECK_EQUAL(s.str(), "789e39cd-967f-41f0-8a17-ccc8f0002eae");
}