text
stringlengths 0
2.2M
|
---|
// should not be used as an example for new development.
|
// ----------------------------------------------------------------------------
|
#include <bosscm_versiontag.h>
|
#include <bsls_ident.h>
|
BSLS_IDENT_RCSID(bosscm_versiontag_cpp,"$Id$ $CSID$")
|
// ----------------------------------------------------------------------------
|
// Copyright 2019 Bloomberg Finance L.P.
|
//
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
// you may not use this file except in compliance with the License.
|
// You may obtain a copy of the License at
|
//
|
// http://www.apache.org/licenses/LICENSE-2.0
|
//
|
// Unless required by applicable law or agreed to in writing, software
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// See the License for the specific language governing permissions and
|
// limitations under the License.
|
// ----------------------------- END-OF-FILE ----------------------------------
|
// bslh_seedgenerator.t.cpp -*-C++-*-
|
#include <bslh_seedgenerator.h>
|
#include <bsls_assert.h>
|
#include <bsls_asserttest.h>
|
#include <bsls_bsltestutil.h>
|
#include <bsls_platform.h>
|
#include <bsls_bsltestutil.h>
|
#include <math.h>
|
#include <wchar.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <string.h>
|
using namespace BloombergLP;
|
using namespace bslh;
|
//=============================================================================
|
// TEST PLAN
|
//-----------------------------------------------------------------------------
|
// Overview
|
// --------
|
// The component under test is a 'bslh' seed generator. The component will
|
// also be tested for conformance to the requirements on 'bslh' seed
|
// generators, outlined in the 'bslh' package level documentation.
|
//-----------------------------------------------------------------------------
|
// CREATORS
|
// [ 2] SeedGenerator()
|
// [ 2] SeedGenerator(RNG& randomNumberGenerator)
|
// [ 2] SeedGenerator(const SeedGenerator)
|
// [ 2] ~SeedGenerator()
|
//
|
// MANIPULATORS
|
// [ 3] void generateSeed(char *seedLocation, size_t seedLength)
|
// ----------------------------------------------------------------------------
|
// [ 1] BREATHING TEST
|
// [ 4] USAGE EXAMPLE
|
//-----------------------------------------------------------------------------
|
// ============================================================================
|
// STANDARD BSL ASSERT TEST FUNCTION
|
// ----------------------------------------------------------------------------
|
namespace {
|
int testStatus = 0;
|
void aSsErT(bool condition, const char *message, int line)
|
{
|
if (condition) {
|
printf("Error " __FILE__ "(%d): %s (failed)\n", line, message);
|
if (0 <= testStatus && testStatus <= 100) {
|
++testStatus;
|
}
|
}
|
}
|
} // close unnamed namespace
|
// ============================================================================
|
// STANDARD BSL TEST DRIVER MACRO ABBREVIATIONS
|
// ----------------------------------------------------------------------------
|
#define ASSERT BSLS_BSLTESTUTIL_ASSERT
|
#define ASSERTV BSLS_BSLTESTUTIL_ASSERTV
|
#define LOOP_ASSERT BSLS_BSLTESTUTIL_LOOP_ASSERT
|
#define LOOP0_ASSERT BSLS_BSLTESTUTIL_LOOP0_ASSERT
|
#define LOOP1_ASSERT BSLS_BSLTESTUTIL_LOOP1_ASSERT
|
#define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT
|
#define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT
|
#define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.