denizzzka / dpq2

@@ -95,7 +95,7 @@
Loading
95 95
        }
96 96
97 97
    }
98 -
    return Value(buffer.data.dup, OidType.VariableBitString, false, ValueFormat.BINARY);
98 +
    return Value(buffer.data.dup, detectOidTypeFromNative!T, false, ValueFormat.BINARY);
99 99
}
100 100
101 101
/// Reverses the order of bits - needed because of dmd Issue 19693
@@ -130,6 +130,19 @@
Loading
130 130
131 131
    assert(v.oidType == OidType.VariableBitString);
132 132
    assert(v.as!BitArray == varbit);
133 +
134 +
    // test softBitswap
135 +
    assert (softBitswap!uint( 0x8000_0100 ) == 0x0080_0001);
136 +
    foreach (i; 0 .. 32)
137 +
        assert (softBitswap!uint(1 << i) == 1 << 32 - i - 1);
138 +
139 +
    assert (softBitswap!ulong( 0b1000000000000000000000010000000000000000100000000000000000000001)
140 +
            == 0b1000000000000000000000010000000000000000100000000000000000000001);
141 +
    assert (softBitswap!ulong( 0b1110000000000000000000010000000000000000100000000000000000000001)
142 +
        == 0b1000000000000000000000010000000000000000100000000000000000000111);
143 +
    foreach (i; 0 .. 64)
144 +
        assert (softBitswap!ulong(1UL << i) == 1UL << 64 - i - 1);
145 +
133 146
}
134 147
135 148
/**

@@ -177,6 +177,18 @@
Loading
177 177
    return res;
178 178
}
179 179
180 +
@system unittest
181 +
{
182 +
    import std.bitmanip : BitArray;
183 +
    import dpq2.conv.from_d_types : toValue;
184 +
185 +
    auto varbit = BitArray([1,0,1,1,0,1,1,1,1,0,1]);
186 +
    Value v = varbit.toValue;
187 +
    auto bson = rawValueToBson(v);
188 +
    assert(bson.toString == "\"101_10111101\"");
189 +
190 +
}
191 +
180 192
version (integration_tests)
181 193
public void _integration_test( string connParam )
182 194
{

@@ -167,6 +167,7 @@
Loading
167 167
168 168
private OidType detectOidTypeNotCareAboutNullable(T)()
169 169
{
170 +
    import std.bitmanip : BitArray;
170 171
    import std.datetime.date : StdDate = Date, TimeOfDay, DateTime;
171 172
    import std.datetime.systime : SysTime;
172 173
    import std.traits : Unqual;
Files Coverage
src/dpq2 92.11%
integration_tests/integration_tests.d 100.00%
Project Totals (19 files) 92.15%
1175.17
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading