| 103 | }; |
| 104 | |
| 105 | TEST_F(TileDBWriterTimeDimTest, test_dims_no_tm_and_use_tm) |
| 106 | { |
| 107 | tiledb::Context ctx; |
| 108 | |
| 109 | std::string out_path1 = Support::temppath("xyztm_tdb_no_tm"); |
| 110 | |
| 111 | if (FileUtils::directoryExists(out_path1)) |
| 112 | FileUtils::deleteDirectory(out_path1); |
| 113 | |
| 114 | Options options1 = getTileDBOptions(); |
| 115 | options1.add("array_name", out_path1); |
| 116 | |
| 117 | TileDBWriter writer1; |
| 118 | writer1.setOptions(options1); |
| 119 | writer1.setInput(m_reader); |
| 120 | |
| 121 | FixedPointTable table1(count); |
| 122 | writer1.prepare(table1); |
| 123 | writer1.execute(table1); |
| 124 | |
| 125 | tiledb::Array array_no_time(ctx, out_path1, TILEDB_READ); |
| 126 | auto domain_no_time = array_no_time.non_empty_domain<double>(); |
| 127 | |
| 128 | EXPECT_EQ(domain_no_time.size(), 3); |
| 129 | |
| 130 | std::string out_path2 = Support::temppath("xyztm_tdb_use_tm"); |
| 131 | |
| 132 | if (FileUtils::directoryExists(out_path2)) |
| 133 | FileUtils::deleteDirectory(out_path2); |
| 134 | |
| 135 | Options options2 = getTileDBOptions(); |
| 136 | options2.add("array_name", out_path2); |
| 137 | options2.add("use_time_dim", true); |
| 138 | |
| 139 | TileDBWriter writer2; |
| 140 | writer2.setOptions(options2); |
| 141 | writer2.setInput(m_reader); |
| 142 | |
| 143 | FixedPointTable table2(count); |
| 144 | writer2.prepare(table2); |
| 145 | writer2.execute(table2); |
| 146 | |
| 147 | tiledb::Array array_with_time(ctx, out_path2, TILEDB_READ); |
| 148 | auto domain_with_time = array_with_time.non_empty_domain<double>(); |
| 149 | |
| 150 | EXPECT_EQ(domain_with_time.size(), 4); |
| 151 | |
| 152 | std::vector<std::string> dim_names{"X", "Y", "Z", "GpsTime"}; |
| 153 | |
| 154 | size_t idx; |
| 155 | for (idx = 0; idx != 3; idx++) |
| 156 | { |
| 157 | EXPECT_EQ(dim_names.at(idx), domain_no_time.at(idx).first); |
| 158 | } |
| 159 | |
| 160 | idx = 0; |
| 161 | for (const auto& name : dim_names) |
| 162 | { |
nothing calls this directly
no test coverage detected