blob: 1c5fe85f5c0790388bb5bdbc03ae35e29d3007c7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/log/log.h>
LOG_SETUP("prettyfloat_test");
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/util/rawbuf.h>
#include <vespa/searchlib/common/hitrank.h>
using namespace search;
TEST_SETUP(Test);
int
Test::Main()
{
TEST_INIT("prettyfloat_test");
{
RawBuf buf(5000);
SignedHitRank rank = 10;
buf.addSignedHitRank(rank);
*buf.GetWritableFillPos() = '\0';
EXPECT_EQUAL(std::string("10"), buf.GetDrainPos());
}
{
RawBuf buf(5000);
HitRank rank = 10;
buf.addHitRank(rank);
*buf.GetWritableFillPos() = '\0';
EXPECT_EQUAL(std::string("10"), buf.GetDrainPos());
}
TEST_DONE();
}
|