@@ -309,7 +309,7 @@ TEST(DBFFieldTest, SetAndGetLogicalFalse)
309309 fs::remove (filename);
310310}
311311
312- TEST (DBFFieldTest, SetAndGetLogicalInvalid )
312+ TEST (DBFFieldTest, SetLogicalInvalid )
313313{
314314 const auto filename =
315315 fs::temp_directory_path () / GenerateUniqueFilename (" .dbf" );
@@ -318,6 +318,29 @@ TEST(DBFFieldTest, SetAndGetLogicalInvalid)
318318 fs::remove (filename);
319319}
320320
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+
321344static auto WriteDuplicateFields (const fs::path &filename) -> auto
322345{
323346 const auto handle = DBFCreate (filename.string ().c_str ());
0 commit comments