MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / pristineMapTest

Method pristineMapTest

test/file_format_t.cpp:880–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878
879
880void FileFormatTest::pristineMapTest()
881{
882 auto spot_color = std::make_unique<MapColor>(QString::fromLatin1("spot color"), 0);
883 spot_color->setSpotColorName(QString::fromLatin1("SPOTCOLOR"));
884 spot_color->setCmyk({0.1f, 0.2f, 0.3f, 0.4f});
885 spot_color->setRgbFromCmyk();
886
887 auto mixed_color = std::make_unique<MapColor>(QString::fromLatin1("mixed color"), 1);
888 mixed_color->setSpotColorComposition({ {&*spot_color, 0.5f} });
889 mixed_color->setCmykFromSpotColors();
890 mixed_color->setRgbFromCmyk();
891
892 auto custom_color = std::make_unique<MapColor>(QString::fromLatin1("custom color"), 2);
893 custom_color->setSpotColorComposition({ {&*spot_color, 0.5f} });
894 custom_color->setCmyk({0.1f, 0.2f, 0.3f, 0.4f});
895 custom_color->setRgb({0.5f, 0.6f, 0.7f});
896
897 Map map {};
898 map.addColor(spot_color.release(), 0);
899 map.addColor(mixed_color.release(), 1);
900 map.addColor(custom_color.release(), 2);
901
902 XMLFileFormat format;
903 auto reloaded_map = saveAndLoadMap(map, &format);
904 QVERIFY(bool(reloaded_map));
905 compareMaps(*reloaded_map, map);
906}
907
908
909

Callers

nothing calls this directly

Calls 9

saveAndLoadMapFunction · 0.85
compareMapsFunction · 0.85
setSpotColorNameMethod · 0.80
setCmykMethod · 0.80
setRgbFromCmykMethod · 0.80
setCmykFromSpotColorsMethod · 0.80
setRgbMethod · 0.80
addColorMethod · 0.45

Tested by

no test coverage detected