blob: 0398a463c545078deb47a37c9642ec82581ded43 (
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 2016 Yahoo Inc. 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();
}
|