serialize: add vectored mode

This commit is contained in:
Justin Viiret 2017-03-01 13:12:39 +11:00 committed by Matthew Barr
parent 834aebe8b6
commit a97ec56aee

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Intel Corporation * Copyright (c) 2015-2017, Intel Corporation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -45,9 +45,10 @@ namespace {
using namespace std; using namespace std;
using namespace testing; using namespace testing;
static const unsigned validModes[] = { static constexpr unsigned validModes[] = {
HS_MODE_STREAM, HS_MODE_STREAM,
HS_MODE_NOSTREAM HS_MODE_NOSTREAM,
HS_MODE_VECTORED
}; };
class Serializep : public TestWithParam<unsigned> { class Serializep : public TestWithParam<unsigned> {
@ -75,6 +76,10 @@ TEST_P(Serializep, DeserializeFromAnyAlignment) {
break; break;
case HS_MODE_NOSTREAM: case HS_MODE_NOSTREAM:
mode_string = "BLOCK"; mode_string = "BLOCK";
break;
case HS_MODE_VECTORED:
mode_string = "VECTORED";
break;
} }
ASSERT_NE(nullptr, original_info) << "hs_serialized_database_info returned null."; ASSERT_NE(nullptr, original_info) << "hs_serialized_database_info returned null.";
@ -153,6 +158,10 @@ TEST_P(Serializep, DeserializeAtFromAnyAlignment) {
break; break;
case HS_MODE_NOSTREAM: case HS_MODE_NOSTREAM:
mode_string = "BLOCK"; mode_string = "BLOCK";
break;
case HS_MODE_VECTORED:
mode_string = "VECTORED";
break;
} }
ASSERT_NE(nullptr, original_info) << "hs_serialized_database_info returned null."; ASSERT_NE(nullptr, original_info) << "hs_serialized_database_info returned null.";