@@ -309,7 +309,7 @@ TEST(DBFFieldTest, SetAndGetLogicalFalse)
309
309
fs::remove (filename);
310
310
}
311
311
312
- TEST (DBFFieldTest, SetAndGetLogicalInvalid )
312
+ TEST (DBFFieldTest, SetLogicalInvalid )
313
313
{
314
314
const auto filename =
315
315
fs::temp_directory_path () / GenerateUniqueFilename (" .dbf" );
@@ -318,6 +318,29 @@ TEST(DBFFieldTest, SetAndGetLogicalInvalid)
318
318
fs::remove (filename);
319
319
}
320
320
321
+ TEST (DBFFieldTest, SetAndGetDouble)
322
+ {
323
+ const auto filename =
324
+ fs::temp_directory_path () / GenerateUniqueFilename (" .dbf" );
325
+ constexpr const double value = 1623819823.809 ;
326
+ {
327
+ const auto handle = DBFCreate (filename.string ().c_str ());
328
+ EXPECT_NE (nullptr , handle);
329
+ const auto fid = DBFAddField (handle, " double" , FTDouble, 14 , 4 );
330
+ EXPECT_GE (fid, 0 );
331
+ const auto success = DBFWriteDoubleAttribute (handle, 0 , 0 , value);
332
+ EXPECT_TRUE (success);
333
+ DBFClose (handle);
334
+ }
335
+ {
336
+ const auto handle = DBFOpen (filename.string ().c_str (), " r" );
337
+ EXPECT_NE (nullptr , handle);
338
+ EXPECT_EQ (value, DBFReadDoubleAttribute (handle, 0 , 0 ));
339
+ DBFClose (handle);
340
+ }
341
+ fs::remove (filename);
342
+ }
343
+
321
344
static auto WriteDuplicateFields (const fs::path &filename) -> auto
322
345
{
323
346
const auto handle = DBFCreate (filename.string ().c_str ());
0 commit comments