EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.expression]

COVERAGE SUMMARY FOR SOURCE FILE [AggregateDataCountAll.java]

nameclass, %method, %block, %line, %
AggregateDataCountAll.java100% (1/1)100% (3/3)80%  (24/30)76%  (6.8/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AggregateDataCountAll100% (1/1)100% (3/3)80%  (24/30)76%  (6.8/9)
getValue (Database, int, boolean): Value 100% (1/1)75%  (12/16)71%  (2.8/4)
add (Database, int, boolean, Value): void 100% (1/1)82%  (9/11)75%  (3/4)
AggregateDataCountAll (): void 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.expression;
7 
8import org.h2.engine.Database;
9import org.h2.message.DbException;
10import org.h2.value.Value;
11import org.h2.value.ValueLong;
12import org.h2.value.ValueNull;
13 
14/**
15 * Data stored while calculating a COUNT(*) aggregate.
16 */
17class AggregateDataCountAll extends AggregateData {
18    private long count;
19 
20    @Override
21    void add(Database database, int dataType, boolean distinct, Value v) {
22        if (distinct) {
23            throw DbException.throwInternalError();
24        }
25        count++;
26    }
27 
28    @Override
29    Value getValue(Database database, int dataType, boolean distinct) {
30        if (distinct) {
31            throw DbException.throwInternalError();
32        }
33        Value v = ValueLong.get(count);
34        return v == null ? ValueNull.INSTANCE : v.convertTo(dataType);
35    }
36 
37}

[all classes][org.h2.expression]
EMMA 2.0.5312 (C) Vladimir Roubtsov